From afc30226ac3bb0430a80a8607f5abf4a88551b8a Mon Sep 17 00:00:00 2001 From: zago Date: Thu, 29 Jun 2017 15:45:27 +0200 Subject: fixe error --- models/cards.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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}}); -- cgit v1.2.3-1-g7c22 From 6ec217a5e27154f51ab297fc1053b806f04a86bd Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Thu, 29 Jun 2017 20:32:24 +0300 Subject: Fix: REST API: Add PUT method to update a card. Thanks to zarnifoulette ! Related to #1037 --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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! -- cgit v1.2.3-1-g7c22