Revert "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."

This reverts commit 5e810202bb.
This commit is contained in:
Julien Froidefond
2025-12-15 16:01:26 +01:00
parent 5e810202bb
commit 177b34d70f
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 } from "../errors";
import { ValidationError, NotFoundError, ConflictError } from "../errors";
export interface CreateChallengeInput {
challengerId: string;
@@ -293,13 +293,13 @@ export class ChallengeService {
updateData.status = data.status;
}
if (data.adminId !== undefined) {
updateData.admin = data.adminId ? { connect: { id: data.adminId } } : { disconnect: true };
updateData.adminId = data.adminId;
}
if (data.adminComment !== undefined) {
updateData.adminComment = data.adminComment;
}
if (data.winnerId !== undefined) {
updateData.winner = data.winnerId ? { connect: { id: data.winnerId } } : { disconnect: true };
updateData.winnerId = data.winnerId;
}
return prisma.challenge.update({