feat: allow tournament code replacement
This commit is contained in:
1 parent
1272c81fa9
commit
303886ed53
5 files changed
+537
-37
No files matched your search
@@ -7,6 +7,7 @@ import {
|
||||
HttpCode,
|
||||
HttpStatus,
|
||||
Param,
|
||||
ParseIntPipe,
|
||||
Post,
|
||||
Query,
|
||||
UseGuards,
|
||||
@@ -71,6 +72,21 @@ export class TournamentCodeController {
|
||||
return this.tournamentCodeService.stats();
|
||||
}
|
||||
|
||||
@Post('matches/:matchId/games/:gameNumber/replace')
|
||||
public async replaceForMatchGame(
|
||||
@CurrentUser() currentUser: UserDocument,
|
||||
@Param('communityId', ParseObjectIdPipe)
|
||||
communityId: mongoose.Types.ObjectId,
|
||||
@Param('matchId', ParseObjectIdPipe) matchId: mongoose.Types.ObjectId,
|
||||
@Param('gameNumber', ParseIntPipe) gameNumber: number,
|
||||
) {
|
||||
this.assertSameCommunity(currentUser, communityId);
|
||||
return this.tournamentCodeService.replaceForMatchGame({
|
||||
matchId,
|
||||
gameNumber,
|
||||
});
|
||||
}
|
||||
|
||||
@Post(':id/release')
|
||||
public async restore(
|
||||
@CurrentUser() currentUser: UserDocument,
|
||||
|
||||
Reference in new issue
Block a user