summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2020-07-21 21:03:00 +0300
committerGitHub <noreply@github.com>2020-07-21 21:03:00 +0300
commiteba8fb4c9c73dec6f884be7c0905fca96a2d01b4 (patch)
treed77c8e631adeb2ac02412c29b7f1cef41f795316
parentf6e9f5a5e8423fed9eaadaf196b46273eca241d0 (diff)
parent95522ebcd9100340a8d56a77103ec163185f6d05 (diff)
downloadwekan-eba8fb4c9c73dec6f884be7c0905fca96a2d01b4.tar.gz
wekan-eba8fb4c9c73dec6f884be7c0905fca96a2d01b4.tar.bz2
wekan-eba8fb4c9c73dec6f884be7c0905fca96a2d01b4.zip
Merge pull request #3215 from gvespignani70/develop
changed edit_card and get_card_by_customfields
-rw-r--r--models/cards.js66
-rw-r--r--models/users.js6
2 files changed, 32 insertions, 40 deletions
diff --git a/models/cards.js b/models/cards.js
index 2fd52827..04d187b3 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -2420,34 +2420,6 @@ if (Meteor.isServer) {
},
);
}
- if (req.body.hasOwnProperty('listId')) {
- const newParamListId = req.body.listId;
- Cards.direct.update(
- {
- _id: paramCardId,
- listId: paramListId,
- boardId: paramBoardId,
- archived: false,
- },
- {
- $set: {
- listId: newParamListId,
- },
- },
- );
-
- const card = Cards.findOne({
- _id: paramCardId,
- });
- cardMove(
- req.body.authorId,
- card,
- {
- fieldName: 'listId',
- },
- paramListId,
- );
- }
if (req.body.hasOwnProperty('parentId')) {
const newParentId = req.body.parentId;
Cards.direct.update(
@@ -2691,6 +2663,34 @@ if (Meteor.isServer) {
{ $set: { swimlaneId: newParamSwimlaneId } },
);
}
+ if (req.body.hasOwnProperty('listId')) {
+ const newParamListId = req.body.listId;
+ Cards.direct.update(
+ {
+ _id: paramCardId,
+ listId: paramListId,
+ boardId: paramBoardId,
+ archived: false,
+ },
+ {
+ $set: {
+ listId: newParamListId,
+ },
+ },
+ );
+
+ const card = Cards.findOne({
+ _id: paramCardId,
+ });
+ cardMove(
+ req.body.authorId,
+ card,
+ {
+ fieldName: 'listId',
+ },
+ paramListId,
+ );
+ }
JsonRoutes.sendResult(res, {
code: 200,
data: {
@@ -2772,15 +2772,7 @@ if (Meteor.isServer) {
},
},
archived: false,
- }).map(function(doc) {
- return {
- _id: doc._id,
- title: doc.title,
- description: doc.description,
- listId: doc.listId,
- swinlaneId: doc.swinlaneId,
- };
- }),
+ }).fetch(),
});
},
);
diff --git a/models/users.js b/models/users.js
index 7c5d2855..0ff9d017 100644
--- a/models/users.js
+++ b/models/users.js
@@ -1136,9 +1136,9 @@ if (Meteor.isServer) {
*/
const Future = require('fibers/future');
- let future1 = new Future();
- let future2 = new Future();
- let future3 = new Future();
+ const future1 = new Future();
+ const future2 = new Future();
+ const future3 = new Future();
Boards.insert(
{
title: TAPi18n.__('templates'),