@noxfly/noxus 1.1.6 → 1.1.7
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/noxus.js +3 -0
- package/dist/noxus.mjs +3 -0
- package/package.json +1 -1
- package/src/router.ts +5 -0
package/dist/noxus.js
CHANGED
|
@@ -1035,6 +1035,9 @@ var _Router = class _Router {
|
|
|
1035
1035
|
}
|
|
1036
1036
|
const action = controllerInstance[routeDef.handler];
|
|
1037
1037
|
response.body = await action.call(controllerInstance, request, response);
|
|
1038
|
+
if (response.body === void 0) {
|
|
1039
|
+
response.body = {};
|
|
1040
|
+
}
|
|
1038
1041
|
}, "dispatch");
|
|
1039
1042
|
await dispatch(0);
|
|
1040
1043
|
}
|
package/dist/noxus.mjs
CHANGED
|
@@ -958,6 +958,9 @@ var _Router = class _Router {
|
|
|
958
958
|
}
|
|
959
959
|
const action = controllerInstance[routeDef.handler];
|
|
960
960
|
response.body = await action.call(controllerInstance, request, response);
|
|
961
|
+
if (response.body === void 0) {
|
|
962
|
+
response.body = {};
|
|
963
|
+
}
|
|
961
964
|
}, "dispatch");
|
|
962
965
|
await dispatch(0);
|
|
963
966
|
}
|
package/package.json
CHANGED
package/src/router.ts
CHANGED
|
@@ -264,6 +264,11 @@ export class Router {
|
|
|
264
264
|
// endpoint action
|
|
265
265
|
const action = controllerInstance[routeDef.handler] as ControllerAction;
|
|
266
266
|
response.body = await action.call(controllerInstance, request, response);
|
|
267
|
+
|
|
268
|
+
// avoid parsing error on the renderer if the action just does treatment without returning anything
|
|
269
|
+
if(response.body === undefined) {
|
|
270
|
+
response.body = {};
|
|
271
|
+
}
|
|
267
272
|
};
|
|
268
273
|
|
|
269
274
|
await dispatch(0);
|