mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: move problem/del to problem/delete
This commit is contained in:
5 files changed
+3
-5
No files matched your search
@@ -636,7 +636,7 @@ export class ContestFileDownloadHandler extends ContestDetailBaseHandler {
|
||||
@param('noDisposition', Types.Boolean)
|
||||
@param('type', Types.Range(['public', 'private']), true)
|
||||
async get(domainId: string, tid: ObjectId, filename: string, noDisposition = false, type = 'private') {
|
||||
if (type === 'private' && !this.user.own(this.tdoc)) {
|
||||
if (type === 'private' && !this.user.own(this.tdoc) && !this.user.hasPerm(PERM.PERM_EDIT_CONTEST)) {
|
||||
if (!this.tsdoc?.attend) throw new ContestNotAttendedError(domainId, tid);
|
||||
if (!contest.isOngoing(this.tdoc) && !contest.isDone(this.tdoc)) throw new ContestNotLiveError(domainId, tid);
|
||||
if (!this.tsdoc.startAt) await contest.setStatus(domainId, tid, this.user._id, { startAt: new Date() });
|
||||
|
||||
@@ -282,7 +282,6 @@ export class ProblemModel {
|
||||
.then((items) => storage.del(items.map((item) => `problem/${domainId}/${docId}/${item.name}`))),
|
||||
bus.parallel('problem/delete', domainId, docId),
|
||||
]);
|
||||
await bus.emit('problem/del', domainId, docId);
|
||||
return !!res[0][0].deletedCount;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,6 @@ export interface EventMap {
|
||||
'problem/before-edit': (doc: Partial<ProblemDoc>, $unset: OnlyFieldsOfType<ProblemDoc, any, true | '' | 1>) => VoidReturn;
|
||||
'problem/edit': (doc: ProblemDoc) => VoidReturn;
|
||||
'problem/before-del': (domainId: string, docId: number) => VoidReturn;
|
||||
'problem/del': (domainId: string, docId: number) => VoidReturn;
|
||||
'problem/list': (query: Filter<ProblemDoc>, handler: any, sort?: string[]) => VoidReturn;
|
||||
'problem/get': (doc: ProblemDoc, handler: any) => VoidReturn;
|
||||
'problem/delete': (domainId: string, docId: number) => VoidReturn;
|
||||
|
||||
Reference in new issue
Block a user