@noxfly/noxus 1.1.6 → 1.1.8

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 CHANGED
@@ -1030,11 +1030,14 @@ var _Router = class _Router {
1030
1030
  const guardIndex = i - middlewares2.length;
1031
1031
  const guardType = routeDef.guards[guardIndex];
1032
1032
  await this.runGuard(request, guardType);
1033
- dispatch(i + 1);
1033
+ await dispatch(i + 1);
1034
1034
  return;
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
@@ -953,11 +953,14 @@ var _Router = class _Router {
953
953
  const guardIndex = i - middlewares2.length;
954
954
  const guardType = routeDef.guards[guardIndex];
955
955
  await this.runGuard(request, guardType);
956
- dispatch(i + 1);
956
+ await dispatch(i + 1);
957
957
  return;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noxfly/noxus",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "main": "dist/noxus.js",
5
5
  "types": "dist/noxus.d.ts",
6
6
  "scripts": {
package/src/router.ts CHANGED
@@ -257,13 +257,18 @@ export class Router {
257
257
  const guardIndex = i - middlewares.length;
258
258
  const guardType = routeDef.guards[guardIndex]!;
259
259
  await this.runGuard(request, guardType);
260
- dispatch(i + 1);
260
+ await dispatch(i + 1);
261
261
  return;
262
262
  }
263
263
 
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);