Refactor challenge access checks and update text encoding: Remove unnecessary session variable in update and delete challenge functions. Update text in ChallengeManagement and ChallengesSection components for proper HTML encoding, enhancing display consistency.
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 16s

This commit is contained in:
Julien Froidefond
2025-12-15 15:33:14 +01:00
parent bbb0fbb9a1
commit 699de28868
4 changed files with 9 additions and 9 deletions

View File

@@ -4,7 +4,7 @@ import type {
ChallengeStatus,
Prisma,
} from "@/prisma/generated/prisma/client";
import { ValidationError, NotFoundError, ConflictError } from "../errors";
import { ValidationError, NotFoundError } from "../errors";
export interface CreateChallengeInput {
challengerId: string;
@@ -293,13 +293,13 @@ export class ChallengeService {
updateData.status = data.status;
}
if (data.adminId !== undefined) {
updateData.adminId = data.adminId;
updateData.admin = data.adminId ? { connect: { id: data.adminId } } : { disconnect: true };
}
if (data.adminComment !== undefined) {
updateData.adminComment = data.adminComment;
}
if (data.winnerId !== undefined) {
updateData.winnerId = data.winnerId;
updateData.winner = data.winnerId ? { connect: { id: data.winnerId } } : { disconnect: true };
}
return prisma.challenge.update({