Skip to content

Commit

Permalink
fix: @feathersjs/express: replace reduce with map (#1429)
Browse files Browse the repository at this point in the history
  • Loading branch information
vonagam authored and daffl committed Jul 3, 2019
1 parent 9585ac0 commit 44542e9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/express/lib/rest/getHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ function getAllowedMethods (service, routes) {
}

function makeArgsGetter (argsOrder) {
return (req, params) => argsOrder.reduce((result, argName) => {
return (req, params) => argsOrder.map((argName) => {
switch (argName) {
case 'id':
return [ ...result, req.params.__feathersId || null ];
return req.params.__feathersId || null;
case 'data':
return [ ...result, req.body ];
return req.body;
case 'params':
return [ ...result, params ];
return params;
}
}, []);
});
}

// A function that returns the middleware for a given method and service
Expand Down

0 comments on commit 44542e9

Please sign in to comment.