@routr/pgdata 2.0.8-alpha.27 → 2.0.8-alpha.29
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.
- package/dist/api/create.js +3 -3
- package/dist/api/delete.js +2 -2
- package/dist/api/update.js +3 -3
- package/package.json +4 -4
package/dist/api/create.js
CHANGED
|
@@ -54,7 +54,7 @@ exports.create = void 0;
|
|
|
54
54
|
/* eslint-disable require-jsdoc */
|
|
55
55
|
const grpc = __importStar(require("@grpc/grpc-js"));
|
|
56
56
|
const pb_util_1 = require("pb-util");
|
|
57
|
-
const
|
|
57
|
+
const common_1 = require("@routr/common");
|
|
58
58
|
const utils_1 = require("../mappers/utils");
|
|
59
59
|
const runtime_1 = require("@prisma/client/runtime");
|
|
60
60
|
function create(operation, kind) {
|
|
@@ -85,10 +85,10 @@ function create(operation, kind) {
|
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
else if (e.code === "P2002") {
|
|
88
|
-
callback(new
|
|
88
|
+
callback(new common_1.CommonErrors.BadRequestError("entity already exist for field: " + e.meta.target[0]), null);
|
|
89
89
|
}
|
|
90
90
|
else if (e.code === "P2003") {
|
|
91
|
-
callback(new
|
|
91
|
+
callback(new common_1.CommonErrors.BadRequestError("dependent entity doesn't exist for: " + e.meta.field_name), null);
|
|
92
92
|
}
|
|
93
93
|
else {
|
|
94
94
|
callback(e, null);
|
package/dist/api/delete.js
CHANGED
|
@@ -54,12 +54,12 @@ exports.del = void 0;
|
|
|
54
54
|
/* eslint-disable require-jsdoc */
|
|
55
55
|
const grpc = __importStar(require("@grpc/grpc-js"));
|
|
56
56
|
const runtime_1 = require("@prisma/client/runtime");
|
|
57
|
-
const
|
|
57
|
+
const common_1 = require("@routr/common");
|
|
58
58
|
// TODO: Fix the error handling. We should return the error
|
|
59
59
|
function del(operation) {
|
|
60
60
|
return (call, callback) => __awaiter(this, void 0, void 0, function* () {
|
|
61
61
|
if (!call.request.ref) {
|
|
62
|
-
return callback(new
|
|
62
|
+
return callback(new common_1.CommonErrors.BadRequestError("parameter ref is required"), null);
|
|
63
63
|
}
|
|
64
64
|
try {
|
|
65
65
|
yield operation({
|
package/dist/api/update.js
CHANGED
|
@@ -30,7 +30,7 @@ exports.update = void 0;
|
|
|
30
30
|
*/
|
|
31
31
|
/* eslint-disable require-jsdoc */
|
|
32
32
|
const pb_util_1 = require("pb-util");
|
|
33
|
-
const
|
|
33
|
+
const common_1 = require("@routr/common");
|
|
34
34
|
const utils_1 = require("../mappers/utils");
|
|
35
35
|
const connect_1 = require("@routr/common/src/connect");
|
|
36
36
|
const client_1 = require("@prisma/client");
|
|
@@ -75,10 +75,10 @@ function update(operation, kind) {
|
|
|
75
75
|
}
|
|
76
76
|
catch (e) {
|
|
77
77
|
if (e.code === "P2025") {
|
|
78
|
-
callback(new
|
|
78
|
+
callback(new common_1.CommonErrors.ResourceNotFoundError(call.request.ref), null);
|
|
79
79
|
}
|
|
80
80
|
else if (e.code === "P2003") {
|
|
81
|
-
callback(new
|
|
81
|
+
callback(new common_1.CommonErrors.BadRequestError("dependent entity doesn't exist for: " + e.meta.field_name), null);
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
84
84
|
callback(e, null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routr/pgdata",
|
|
3
|
-
"version": "2.0.8-alpha.
|
|
3
|
+
"version": "2.0.8-alpha.29",
|
|
4
4
|
"description": "Postgres API Server for Routr Connect",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/routr#readme",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"@opentelemetry/sdk-trace-node": "^1.0.4",
|
|
31
31
|
"@opentelemetry/semantic-conventions": "^1.0.4",
|
|
32
32
|
"@prisma/client": "^4.8.0",
|
|
33
|
-
"@routr/common": "^2.0.8-alpha.
|
|
34
|
-
"@routr/processor": "^2.0.8-alpha.
|
|
33
|
+
"@routr/common": "^2.0.8-alpha.29",
|
|
34
|
+
"@routr/processor": "^2.0.8-alpha.29",
|
|
35
35
|
"google-protobuf": "^3.9.2",
|
|
36
36
|
"pb-util": "^1.0.3",
|
|
37
37
|
"phone": "^3.1.32",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"@types/validator": "^13.7.10",
|
|
56
56
|
"prisma": "^4.8.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "f273cfb052bd734a906ab97011e1338ceac53111"
|
|
59
59
|
}
|