changed edit_card and get_card_by_customfields

There was a bug in edit_card API: If I call API to edit listid and some fields It modifies only the listid. In addiction I've modified get_card_by_customfield to return full documents.
This commit is contained in:
Unknown 2020-07-21 17:36:46 +02:00
parent 8bf13f43e8
commit 95522ebcd9
2 changed files with 32 additions and 40 deletions

View file

@ -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(),
});
},
);

View file

@ -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'),