summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-05-12 20:27:50 +0300
committerGitHub <noreply@github.com>2019-05-12 20:27:50 +0300
commit8a0efffdf8234336c2f93422f7d7eef2a07c69b3 (patch)
treed88d76f4e2ebf717dee2660f1b8b611661d3ad48
parentc21f710a705f7c6c8eeeb4dcce17fc24b1960441 (diff)
parentf3382abe3bc1cd9d5583708d5fdbe550e57a8a38 (diff)
downloadwekan-8a0efffdf8234336c2f93422f7d7eef2a07c69b3.tar.gz
wekan-8a0efffdf8234336c2f93422f7d7eef2a07c69b3.tar.bz2
wekan-8a0efffdf8234336c2f93422f7d7eef2a07c69b3.zip
Merge pull request #2400 from atilaromero/devel
Add partentId support on card web API
-rw-r--r--models/cards.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/models/cards.js b/models/cards.js
index d5a59377..fdb7deb3 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -1685,6 +1685,7 @@ if (Meteor.isServer) {
* @param {string} boardId the board ID of the new card
* @param {string} listId the list ID of the new card
* @param {string} authorID the user ID of the person owning the card
+ * @param {string} parentId the parent ID of the new card
* @param {string} title the title of the new card
* @param {string} description the description of the new card
* @param {string} swimlaneId the swimlane ID of the new card
@@ -1695,6 +1696,7 @@ if (Meteor.isServer) {
Authentication.checkUserId(req.userId);
const paramBoardId = req.params.boardId;
const paramListId = req.params.listId;
+ const paramParentId = req.params.parentId;
const currentCards = Cards.find({
listId: paramListId,
archived: false,
@@ -1708,6 +1710,7 @@ if (Meteor.isServer) {
title: req.body.title,
boardId: paramBoardId,
listId: paramListId,
+ parentId: paramParentId,
description: req.body.description,
userId: req.body.authorId,
swimlaneId: req.body.swimlaneId,
@@ -1761,6 +1764,7 @@ if (Meteor.isServer) {
* @param {string} [listId] the new list ID of the card (move operation)
* @param {string} [description] the new description of the card
* @param {string} [authorId] change the owner of the card
+ * @param {string} [parentId] change the parent of the card
* @param {string} [labelIds] the new list of label IDs attached to the card
* @param {string} [swimlaneId] the new swimlane ID of the card
* @param {string} [members] the new list of member IDs attached to the card
@@ -1817,6 +1821,19 @@ if (Meteor.isServer) {
}, paramListId);
}
+ if (req.body.hasOwnProperty('parentId')) {
+ const newParentId = req.body.parentId;
+ Cards.direct.update({
+ _id: paramCardId,
+ listId: paramListId,
+ boardId: paramBoardId,
+ archived: false,
+ }, {
+ $set: {
+ parentId: newParentId,
+ },
+ });
+ }
if (req.body.hasOwnProperty('description')) {
const newDescription = req.body.description;
Cards.direct.update({