mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
workspace: use esnext set operations
This commit is contained in:
12 files changed
+28
-43
No files matched your search
@@ -88,7 +88,7 @@ export class ContestDetailBaseHandler extends Handler {
|
||||
]);
|
||||
if (this.tdoc.assign?.length && !this.user.own(this.tdoc) && !this.user.hasPerm(PERM.PERM_VIEW_HIDDEN_CONTEST)) {
|
||||
const groups = await user.listGroup(domainId, this.user._id);
|
||||
if (!Set.intersection(this.tdoc.assign, groups.map((i) => i.name)).size) {
|
||||
if (!new Set(this.tdoc.assign).intersection(new Set(groups.map((i) => i.name))).size) {
|
||||
throw new NotAssignedError('contest', tid);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user