Skip to content

Commit

Permalink
chore: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ymc9 committed Aug 24, 2024
1 parent 5bfd695 commit b1bcfe9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/server/src/api/rest/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/api/rpc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { logError, registerCustomSerializers } from '../utils';
registerCustomSerializers();

const ERROR_STATUS_MAPPING: Record<string, number> = {
[PrismaErrorCode.CONSTRAINED_FAILED]: 403,
[PrismaErrorCode.CONSTRAINT_FAILED]: 403,
[PrismaErrorCode.REQUIRED_CONNECTED_RECORD_NOT_FOUND]: 404,
[PrismaErrorCode.DEPEND_ON_RECORD_NOT_FOUND]: 404,
};
Expand Down

0 comments on commit b1bcfe9

Please sign in to comment.