minimonolith 0.25.16 → 0.25.18
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/README.md +2 -2
- package/package.json +1 -1
- package/service/postRoute/handler.js +6 -1
- package/service/services.js +1 -1
package/README.md
CHANGED
|
@@ -109,12 +109,12 @@ export default async ({ body, MODELS }) => {
|
|
|
109
109
|
}
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
### todo/get/
|
|
112
|
+
### todo/get/in.js
|
|
113
113
|
|
|
114
114
|
This file validates the `get:id` service's input, ensuring that the provided `id` is a string and exists in the `todo` model:
|
|
115
115
|
|
|
116
116
|
```js
|
|
117
|
-
// todo/get/
|
|
117
|
+
// todo/get/in.js
|
|
118
118
|
import { z, zdb } from 'minimonolith';
|
|
119
119
|
|
|
120
120
|
export default ({ MODELS }) => ({
|
package/package.json
CHANGED
|
@@ -38,7 +38,12 @@ export default async ({ body, ROUTE_CODE, SERVICES }) => {
|
|
|
38
38
|
|
|
39
39
|
} catch (SERVICE_ERROR) {
|
|
40
40
|
if (!service.error) {
|
|
41
|
-
|
|
41
|
+
console.log('here', SERVICE_ERROR);
|
|
42
|
+
const serviceRouteCode =
|
|
43
|
+
await SERVICES.service.getRouteCode.handler({
|
|
44
|
+
moduleName, serviceName });
|
|
45
|
+
await SERVICES.api.postError.handler({
|
|
46
|
+
[serviceRouteCode]: SERVICE_ERROR });
|
|
42
47
|
res.status(500).json(SERVICE_ERROR);
|
|
43
48
|
return;
|
|
44
49
|
}
|