Skip to content

Commit 411ef11

Browse files
committed
fix: make calls on server and client side arguments uniform.
1 parent 426ddcb commit 411ef11

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/plugins/api.template.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function generateAPI(controllerMapping) {
4444
Object.keys(controllerMapping).forEach(function (key) {
4545
const context = controllerMapping[key];
4646
if (context && context.path && context.verb) {
47-
api[key] = function ({params, ...values}) {
47+
api[key] = function ({params, ...values} = {}) {
4848
return ApiHandler(
4949
injectParamsIntoPath(
5050
context.path[context.path.length - 1] === '/' ?

lib/utility/controllers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function controllerMappingServerSide(directory, req, options) {
127127
: ResponseMiddleware;
128128

129129
return controllerMapping(options.directory, function (ControllerClass, actionName) {
130-
return function (params, body, query) {
130+
return function ({params, body, query} = {}) {
131131
try {
132132
return Promise.resolve(new ControllerClass(req)[actionName]({
133133
params: params || {},

0 commit comments

Comments
 (0)