From b1bcfe904ff630fd0bcf6a8f696b0c096e81a510 Mon Sep 17 00:00:00 2001 From: ymc9 <104139426+ymc9@users.noreply.github.com> Date: Fri, 23 Aug 2024 21:13:18 -0700 Subject: [PATCH] chore: fix build --- packages/server/src/api/rest/index.ts | 2 +- packages/server/src/api/rpc/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/rest/index.ts b/packages/server/src/api/rest/index.ts index 022ac72a7..75b2f738b 100644 --- a/packages/server/src/api/rest/index.ts +++ b/packages/server/src/api/rest/index.ts @@ -1589,7 +1589,7 @@ class RequestHandler extends APIHandlerBase { private handlePrismaError(err: unknown) { if (isPrismaClientKnownRequestError(err)) { - if (err.code === PrismaErrorCode.CONSTRAINED_FAILED) { + if (err.code === PrismaErrorCode.CONSTRAINT_FAILED) { if (err.meta?.reason === CrudFailureReason.DATA_VALIDATION_VIOLATION) { return this.makeError( 'validationError', diff --git a/packages/server/src/api/rpc/index.ts b/packages/server/src/api/rpc/index.ts index a8882b8be..a1a71c1c6 100644 --- a/packages/server/src/api/rpc/index.ts +++ b/packages/server/src/api/rpc/index.ts @@ -18,7 +18,7 @@ import { logError, registerCustomSerializers } from '../utils'; registerCustomSerializers(); const ERROR_STATUS_MAPPING: Record = { - [PrismaErrorCode.CONSTRAINED_FAILED]: 403, + [PrismaErrorCode.CONSTRAINT_FAILED]: 403, [PrismaErrorCode.REQUIRED_CONNECTED_RECORD_NOT_FOUND]: 404, [PrismaErrorCode.DEPEND_ON_RECORD_NOT_FOUND]: 404, };