Skip to content

Fixing exports.update

Rafael J. Rodriguez edited this page · 4 revisions
Clone this wiki locally

As it turns out, in thing.controller.js as well as in any other endpoints you may generate, the exports.update function that is called when you make an $http.put call from your frontend to modify an existing database object is broken. This is a known issue, and can be fixed by changing the following line:

// Updates an existing thing in the DB.
exports.update = function(req, res) { 
...    
    var updated = _.extend(thing, req.body); 
    // change _.merge to _.extend
... 
 };

PREVIOUS NEXT

Something went wrong with that request. Please try again.