-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into renovate/codemirror
- Loading branch information
Showing
23 changed files
with
286 additions
and
46 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
apps/backend/apps/admin/src/submission/enum/contest-submission-order.enum.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export enum ContestSubmissionOrder { | ||
studentIdASC = 'studentId-asc', | ||
studentIdDESC = 'studentId-desc', | ||
realNameASC = 'realName-asc', | ||
realNameDESC = 'realName-desc', | ||
usernameASC = 'username-asc', | ||
usernameDESC = 'username-desc' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
apps/backend/libs/pipe/src/contest-submission-order.pipe.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { | ||
BadRequestException, | ||
Injectable, | ||
type PipeTransform | ||
} from '@nestjs/common' | ||
import { ContestSubmissionOrder } from '@admin/submission/enum/contest-submission-order.enum' | ||
|
||
@Injectable() | ||
export class ContestSubmissionOrderPipe implements PipeTransform { | ||
transform(value: unknown) { | ||
if (!value) { | ||
return null | ||
} else if ( | ||
!Object.values(ContestSubmissionOrder).includes( | ||
value as ContestSubmissionOrder | ||
) | ||
) { | ||
throw new BadRequestException( | ||
'Contest-submission-order validation failed' | ||
) | ||
} | ||
return value | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.