mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: better discussion sort method
This commit is contained in:
1 parent
2232cf9ff5
commit
e7156a7c22
7 files changed
+52
-10
No files matched your search
@@ -158,7 +158,7 @@ class DiscussionCreateHandler extends DiscussionHandler {
|
||||
await this.limitRate('add_discussion', 3600, 60);
|
||||
let name: ObjectID | string | number;
|
||||
if (ObjectID.isValid(_name)) name = new ObjectID(_name);
|
||||
else if (isSafeInteger(parseInt(_name, 10))) name = parseInt(_name, 10);
|
||||
else if (isSafeInteger(+name)) name = +name;
|
||||
else name = _name;
|
||||
if (highlight) this.checkPerm(PERM.PERM_HIGHLIGHT_DISCUSSION);
|
||||
if (pin) this.checkPerm(PERM.PERM_PIN_DISCUSSION);
|
||||
|
||||
Reference in new issue
Block a user