diff options
author | Lauri Ojansivu <x@xet7.org> | 2018-09-07 12:30:06 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2018-09-07 12:30:06 +0300 |
commit | 1e0fdf8abc10130ea3c50b13ae97396223ce7fa9 (patch) | |
tree | 83ccf17282dde6e56374827717a32539f3491969 /models | |
parent | 1d2896886e55244e65117f4785346a673f48722a (diff) | |
download | wekan-1e0fdf8abc10130ea3c50b13ae97396223ce7fa9.tar.gz wekan-1e0fdf8abc10130ea3c50b13ae97396223ce7fa9.tar.bz2 wekan-1e0fdf8abc10130ea3c50b13ae97396223ce7fa9.zip |
- REST API: Add startAt/dueAt/endAt etc. https://github.com/wekan/wekan/wiki/REST-API-Cards
Thanks to xet7 !
Closes #1879
Diffstat (limited to 'models')
-rw-r--r-- | models/cards.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/models/cards.js b/models/cards.js index 927ca9ce..73b9a023 100644 --- a/models/cards.js +++ b/models/cards.js @@ -1149,6 +1149,51 @@ if (Meteor.isServer) { Cards.direct.update({_id: paramCardId, listId: paramListId, boardId: paramBoardId, archived: false}, {$set: {labelIds: newlabelIds}}); } + if (req.body.hasOwnProperty('requestedBy')) { + const newrequestedBy = req.body.requestedBy; + Cards.direct.update({_id: paramCardId, listId: paramListId, boardId: paramBoardId, archived: false}, + {$set: {requestedBy: newrequestedBy}}); + } + if (req.body.hasOwnProperty('assignedBy')) { + const newassignedBy = req.body.assignedBy; + Cards.direct.update({_id: paramCardId, listId: paramListId, boardId: paramBoardId, archived: false}, + {$set: {assignedBy: newassignedBy}}); + } + if (req.body.hasOwnProperty('receivedAt')) { + const newreceivedAt = req.body.receivedAt; + Cards.direct.update({_id: paramCardId, listId: paramListId, boardId: paramBoardId, archived: false}, + {$set: {receivedAt: newreceivedAt}}); + } + if (req.body.hasOwnProperty('startAt')) { + const newstartAt = req.body.startAt; + Cards.direct.update({_id: paramCardId, listId: paramListId, boardId: paramBoardId, archived: false}, + {$set: {startAt: newstartAt}}); + } + if (req.body.hasOwnProperty('dueAt')) { + const newdueAt = req.body.dueAt; + Cards.direct.update({_id: paramCardId, listId: paramListId, boardId: paramBoardId, archived: false}, + {$set: {dueAt: newdueAt}}); + } + if (req.body.hasOwnProperty('endAt')) { + const newendAt = req.body.endAt; + Cards.direct.update({_id: paramCardId, listId: paramListId, boardId: paramBoardId, archived: false}, + {$set: {endAt: newendAt}}); + } + if (req.body.hasOwnProperty('spentTime')) { + const newspentTime = req.body.spentTime; + Cards.direct.update({_id: paramCardId, listId: paramListId, boardId: paramBoardId, archived: false}, + {$set: {spentTime: newspentTime}}); + } + if (req.body.hasOwnProperty('isOverTime')) { + const newisOverTime = req.body.isOverTime; + Cards.direct.update({_id: paramCardId, listId: paramListId, boardId: paramBoardId, archived: false}, + {$set: {isOverTime: newisOverTime}}); + } + if (req.body.hasOwnProperty('customFields')) { + const newcustomFields = req.body.customFields; + Cards.direct.update({_id: paramCardId, listId: paramListId, boardId: paramBoardId, archived: false}, + {$set: {customFields: newcustomFields}}); + } JsonRoutes.sendResult(res, { code: 200, data: { |