Browse Source

don't reassign, sort works inline

pull/850/head
Stephen Hess 8 years ago
parent
commit
446d428292
  1. 3
      middleware/sortResponseData.js

3
middleware/sortResponseData.js

@ -7,7 +7,8 @@ function setup(comparator) {
return next();
}
res.data = res.data.sort(comparator(_.get(req, 'clean', {})));
// sort does so in place
res.data.sort(comparator(_.get(req, 'clean', {})));
next();
}

Loading…
Cancel
Save