refactor: remove legacy match result writers
This commit is contained in:
1 parent
ce07bfa0c8
commit
2958106e42
4 files changed
+48
-319
No files matched your search
@@ -21,8 +21,6 @@ import { ParseObjectIdPipe } from '../common/parse-object-id.pipe';
|
||||
import type { MatchStatus, UserDocument } from '../global/database/schema';
|
||||
import {
|
||||
AddParticipantDto,
|
||||
ApplyDoubleEliminationWalkoverDto,
|
||||
CancelDoubleEliminationActionDto,
|
||||
CreateMatchDto,
|
||||
JoinMatchDto,
|
||||
SwapDoubleEliminationSeedsDto,
|
||||
@@ -169,77 +167,6 @@ export class MatchController {
|
||||
return this.matchService.serialize(match);
|
||||
}
|
||||
|
||||
@Post(':matchId/double-elimination/bracket-matches/:bracketMatchId/walkover')
|
||||
@Roles('admin', 'owner')
|
||||
@UseGuards(RolesGuard)
|
||||
public async applyDoubleEliminationWalkover(
|
||||
@CurrentUser() currentUser: UserDocument,
|
||||
@Param('communityId', ParseObjectIdPipe)
|
||||
communityId: mongoose.Types.ObjectId,
|
||||
@Param('matchId', ParseObjectIdPipe) matchId: mongoose.Types.ObjectId,
|
||||
@Param('bracketMatchId') bracketMatchId: string,
|
||||
@Body() body: ApplyDoubleEliminationWalkoverDto,
|
||||
) {
|
||||
this.assertSameCommunity(currentUser, communityId);
|
||||
const match = await this.matchService.applyDoubleEliminationWalkover({
|
||||
matchId,
|
||||
communityId,
|
||||
actorUserId: currentUser._id,
|
||||
bracketMatchId,
|
||||
winnerTeamIndex: body.winnerTeamIndex,
|
||||
reason: body.reason,
|
||||
});
|
||||
return this.matchService.serialize(match);
|
||||
}
|
||||
|
||||
@Post(
|
||||
':matchId/double-elimination/bracket-matches/:bracketMatchId/walkover/cancel',
|
||||
)
|
||||
@Roles('admin', 'owner')
|
||||
@UseGuards(RolesGuard)
|
||||
public async cancelDoubleEliminationWalkover(
|
||||
@CurrentUser() currentUser: UserDocument,
|
||||
@Param('communityId', ParseObjectIdPipe)
|
||||
communityId: mongoose.Types.ObjectId,
|
||||
@Param('matchId', ParseObjectIdPipe) matchId: mongoose.Types.ObjectId,
|
||||
@Param('bracketMatchId') bracketMatchId: string,
|
||||
@Body() body: CancelDoubleEliminationActionDto,
|
||||
) {
|
||||
this.assertSameCommunity(currentUser, communityId);
|
||||
const match = await this.matchService.cancelDoubleEliminationWalkover({
|
||||
matchId,
|
||||
communityId,
|
||||
actorUserId: currentUser._id,
|
||||
bracketMatchId,
|
||||
reason: body.reason,
|
||||
});
|
||||
return this.matchService.serialize(match);
|
||||
}
|
||||
|
||||
@Post(
|
||||
':matchId/double-elimination/bracket-matches/:bracketMatchId/result/cancel',
|
||||
)
|
||||
@Roles('admin', 'owner')
|
||||
@UseGuards(RolesGuard)
|
||||
public async cancelDoubleEliminationRiotResult(
|
||||
@CurrentUser() currentUser: UserDocument,
|
||||
@Param('communityId', ParseObjectIdPipe)
|
||||
communityId: mongoose.Types.ObjectId,
|
||||
@Param('matchId', ParseObjectIdPipe) matchId: mongoose.Types.ObjectId,
|
||||
@Param('bracketMatchId') bracketMatchId: string,
|
||||
@Body() body: CancelDoubleEliminationActionDto,
|
||||
) {
|
||||
this.assertSameCommunity(currentUser, communityId);
|
||||
const match = await this.matchService.cancelDoubleEliminationRiotResult({
|
||||
matchId,
|
||||
communityId,
|
||||
actorUserId: currentUser._id,
|
||||
bracketMatchId,
|
||||
reason: body.reason,
|
||||
});
|
||||
return this.matchService.serialize(match);
|
||||
}
|
||||
|
||||
@Delete(':matchId')
|
||||
@Roles('admin', 'owner')
|
||||
@UseGuards(RolesGuard)
|
||||
|
||||
Reference in new issue
Block a user