diff options
author | Lauri Ojansivu <x@xet7.org> | 2017-06-29 20:33:37 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2017-06-29 20:33:37 +0300 |
commit | 9ccffe53424679579d64d831796a0060de7ee577 (patch) | |
tree | 6d12931656e3b1168e128e5eb111730b274f7ec6 | |
parent | e8a661e0ea6c33978adf204674caa7ab40a0b3fb (diff) | |
parent | 6ec217a5e27154f51ab297fc1053b806f04a86bd (diff) | |
download | wekan-9ccffe53424679579d64d831796a0060de7ee577.tar.gz wekan-9ccffe53424679579d64d831796a0060de7ee577.tar.bz2 wekan-9ccffe53424679579d64d831796a0060de7ee577.zip |
Merge branch 'zarnifoulette-devel' into devel
Fix: REST API: Add PUT method to update a card.
Thanks to zarnifoulette ! Related to #1037
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | models/cards.js | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index a8bdbbe9..1fd301c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ This release adds the following new features: -* [REST API: Add PUT method to update a card](https://github.com/wekan/wekan/pull/1095). +* [REST API: Add PUT method to update a card](https://github.com/wekan/wekan/pull/1095) and + [related fix](https://github.com/wekan/wekan/pull/1097). Thanks to GitHub user zarnifoulette for contributions! diff --git a/models/cards.js b/models/cards.js index a48690bf..415c3bde 100644 --- a/models/cards.js +++ b/models/cards.js @@ -425,17 +425,17 @@ if (Meteor.isServer) { const paramBoardId = req.params.boardId; const paramCardId = req.params.cardId; const paramListId = req.params.listId; - if(req.body.title !== undefined){ + if(req.body.hasOwnProperty('title')){ const newTitle = req.body.title; Cards.update({ _id: paramCardId, listId: paramListId, boardId: paramBoardId, archived: false }, {$set:{title:newTitle}}); } - if(req.body.listId !== undefined){ + if(req.body.hasOwnProperty('listId')){ const newParamListId = req.body.listId; Cards.update({ _id: paramCardId, listId: paramListId, boardId: paramBoardId, archived: false }, {$set:{listId:newParamListId}}); } - if(req.body.description !== undefined){ + if(req.body.hasOwnProperty('description')){ const newDescription = req.body.description; Cards.update({ _id: paramCardId, listId: paramListId, boardId: paramBoardId, archived: false }, {$set:{description:newDescription}}); |