Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 795 Bytes

Fixing-exports.update.md

File metadata and controls

14 lines (12 loc) · 795 Bytes

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