tests: api.mocha.coffee cleanup WIP
This commit is contained in:
@@ -423,6 +423,7 @@ _.each(shared.wrap({}).ops, function(op,k){
|
||||
------------------------------------------------------------------------
|
||||
*/
|
||||
api.batchUpdate = function(req, res, next) {
|
||||
if (_.isEmpty(req.body)) req.body = []; // cases of {} or null
|
||||
if (req.body[0] && req.body[0].data)
|
||||
return res.json(400, {err: "API has been updated, please refresh your browser or upgrade your mobile app."})
|
||||
|
||||
@@ -441,7 +442,7 @@ api.batchUpdate = function(req, res, next) {
|
||||
};
|
||||
|
||||
// Setup the array of functions we're going to call in parallel with async
|
||||
var ops = _.transform(req.body || [], function(result, _req) {
|
||||
var ops = _.transform(req.body, function(result, _req) {
|
||||
if (!_.isEmpty(_req)) {
|
||||
result.push(function(cb) {
|
||||
callOp(_req, cb);
|
||||
|
||||
Reference in New Issue
Block a user