Skip to content

Commit

Permalink
functional put
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancisZamora committed Jul 20, 2018
1 parent 8b29630 commit 98fe359
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/anchor/anchor-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,9 @@ const register = function (server,serverOptions) {
const id = request.params.id;
const payload = request.payload;
const update = {
$set: {
$set:
payload
}
};
};

return await model.findByIdAndUpdate(id,update);
}
Expand Down
4 changes: 4 additions & 0 deletions server/anchor/anchor-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,10 @@ AnchorModel.routeMap = {
get: {
method: 'GET',
path: '/api/'
},
update: {
method: 'PUT',
path: '/api'
}
};
AnchorModel.timestamps = true;
Expand Down

0 comments on commit 98fe359

Please sign in to comment.