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 3m5s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m5s
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user