This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require('lodash'); | |
var test_data = [ | |
{ id: 'a', order_by: 1 }, | |
{ id: 'b', order_by: 2 }, | |
{ id: 'c', order_by: 3 }, | |
{ id: 'd', order_by: 4 }, | |
{ id: 'e', order_by: 5 }, | |
{ id: 'f', order_by: 6 }, | |
{ id: 'g', order_by: 7 }, | |
{ id: 'h', order_by: 8 }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function required(params) { | |
return function (req, res, cb) { | |
params.every(function (elem) { return req.body.hasOwnProperty(elem); }) | |
&& cb() | |
|| res.send(400); | |
}; | |
}; | |
/** | |
* Sample route |