fix: allow public tournament code replacement
This commit is contained in:
1 parent
303886ed53
commit
b9881fcb6f
7 files changed
+117
-27
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import {
|
||||
Controller,
|
||||
Param,
|
||||
ParseIntPipe,
|
||||
Post,
|
||||
} from '@nestjs/common';
|
||||
import mongoose from 'mongoose';
|
||||
import { AllowPublicAccess } from '../auth/allow-public-access.decorator';
|
||||
import { ParseObjectIdPipe } from '../common/parse-object-id.pipe';
|
||||
import { TournamentCodeService } from './tournament-code.service';
|
||||
|
||||
@Controller('communities/:communityId/tournament-codes')
|
||||
export class TournamentCodeReplacementController {
|
||||
constructor(private readonly tournamentCodeService: TournamentCodeService) {}
|
||||
|
||||
@Post('matches/:matchId/games/:gameNumber/replace')
|
||||
@AllowPublicAccess()
|
||||
public async replaceForMatchGame(
|
||||
@Param('communityId', ParseObjectIdPipe)
|
||||
communityId: mongoose.Types.ObjectId,
|
||||
@Param('matchId', ParseObjectIdPipe) matchId: mongoose.Types.ObjectId,
|
||||
@Param('gameNumber', ParseIntPipe) gameNumber: number,
|
||||
) {
|
||||
return this.tournamentCodeService.replaceForMatchGame({
|
||||
communityId,
|
||||
matchId,
|
||||
gameNumber,
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user