bug fixes & improments

This commit is contained in:
undefined committed 2025-03-22 06:25:06 +08:00
1 parent a0f38d9ad1
commit 3a776c3010
11 files changed
+15 -18

No files matched your search

+1 -1
View File
@@ -72,7 +72,7 @@ class DiscussionMainHandler extends Handler {
const parentType = { $in: Object.keys(typeMapper).map((i) => typeMapper[i]) };
all &&= this.user.hasPerm(PERM.PERM_MOD_BADGE);
const [ddocs, dpcount] = await this.paginate(
discussion.getMulti(domainId, { parentType, ...all ? {} : { hidden: false } }),
discussion.getMulti(domainId, { parentType, ...all ? {} : { hidden: false } }).hint('discussionSort'),
page,
'discussion',
);
+2
View File
@@ -507,6 +507,8 @@ class HomeDomainHandler extends Handler {
@param('id', Types.String)
async postLeave({ }, id: string) {
const ddoc = await domain.get(id);
if (!ddoc) throw new NotFoundError(id);
await domain.setJoin(id, this.user._id, false);
this.back();
}