-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
289 fix ranking api not working (#291)
* querybuilder를 이용한, 제대로 된 ranking api 구현, 버그 수정 완료. 아직은 미완성 * filter out duplicate AC submissions
- Loading branch information
Showing
6 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { RoomCodePipe } from './room-code.pipe'; | ||
|
||
describe('RoomCodePipe', () => { | ||
it('should be defined', () => { | ||
expect(new RoomCodePipe()).toBeDefined(); | ||
}); | ||
}); |
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,19 @@ | ||
import { | ||
ArgumentMetadata, | ||
BadRequestException, | ||
Injectable, | ||
PipeTransform, | ||
} from '@nestjs/common'; | ||
|
||
@Injectable() | ||
export class RoomCodePipe implements PipeTransform { | ||
transform(value: any, _metadata: ArgumentMetadata) { | ||
const hexRegExp = /^[0-9a-fA-F]{6}$/; | ||
|
||
if (!hexRegExp.test(value)) { | ||
throw new BadRequestException('Invalid room code'); | ||
} | ||
|
||
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
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