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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user