@appxdigital/appx-core 0.1.77 → 0.1.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -28,7 +28,7 @@ function handleError(error) {
|
|
|
28
28
|
case 'P2025':
|
|
29
29
|
throw new common_1.NotFoundException('The requested record was not found.');
|
|
30
30
|
case 'P2003':
|
|
31
|
-
throw new common_1.ForbiddenException('
|
|
31
|
+
throw new common_1.ForbiddenException('Foreign key constraint failed:', error.message);
|
|
32
32
|
default:
|
|
33
33
|
throw new common_1.BadRequestException('A Prisma database error occurred.');
|
|
34
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prisma.service.d.ts","sourceRoot":"","sources":["../../src/prisma/prisma.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,qBAAqB,EAAC,MAAM,yCAAyC,CAAC;AAI9E,OAAO,KAAK,EAAC,YAAY,IAAI,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAElE,KAAK,QAAQ,GAAG,MAAM,aAAa,CAAC;AAEpC,qBACa,aAAa;IAOY,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IANpE,OAAO,CAAC,YAAY,CAA2B;IAC/C,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,CAAC,UAAU,CAAc;gBAG5B,YAAY,EAAE,YAAY,EACqB,iBAAiB,EAAE,qBAAqB;IAO3F,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC;IAIpE,WAAW;IA4CX;;;;OAIG;IACH,gBAAgB,CAAC,CAAC,SAAS,QAAQ,EAAE,KAAK,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC;IAYhE,IAAI,KAAK,IAAI,aAAa,CAUzB;IAED,IAAI,IAAI,
|
|
1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5B,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;;;;;;;IAoCzD;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;IAgBvB;;;;;;;OAOG;IACH,OAAO,CAAC,mBAAmB;IA2B3B;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;IAQvB;;;;;;;;;OASG;IACH,OAAO,CAAC,iBAAiB;IAkDzB;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;CAgB9B"}
|
|
@@ -120,7 +120,7 @@ let PrismaService = class PrismaService {
|
|
|
120
120
|
throw new Error(`Model ${model.toString()} not found in PrismaClient.`);
|
|
121
121
|
}
|
|
122
122
|
get model() {
|
|
123
|
-
return new Proxy(
|
|
123
|
+
return new Proxy(this.prismaClient, {
|
|
124
124
|
get: (target, prop) => {
|
|
125
125
|
if (prop in target) {
|
|
126
126
|
return target[prop];
|
|
@@ -416,6 +416,9 @@ let PrismaService = class PrismaService {
|
|
|
416
416
|
* @returns The condition with placeholders replaced by actual values.
|
|
417
417
|
*/
|
|
418
418
|
replacePlaceholders(condition, user) {
|
|
419
|
+
if (condition === null) {
|
|
420
|
+
return null;
|
|
421
|
+
}
|
|
419
422
|
if (typeof condition === 'string') {
|
|
420
423
|
if (condition === '$USER_ID') {
|
|
421
424
|
return user.id;
|
package/package.json
CHANGED