mirror of
https://github.com/wekan/wekan.git
synced 2025-12-29 13:48:49 +01:00
Fix Customfields are not added to new cards created with the API.
Thanks to HEMGDevelopment and xet7 ! Fixes #4810
This commit is contained in:
parent
de67f4fdc7
commit
beaa50551d
1 changed files with 11 additions and 1 deletions
|
|
@ -3327,8 +3327,17 @@ if (Meteor.isServer) {
|
|||
Authentication.checkAdminOrCondition(req.userId, addPermission);
|
||||
const paramListId = req.params.listId;
|
||||
const paramParentId = req.params.parentId;
|
||||
|
||||
const nextCardNumber = board.getNextCardNumber();
|
||||
|
||||
let customFieldsArr = [];
|
||||
_.forEach(
|
||||
CustomFields.find({'boardIds': paramBoardId}).fetch(),
|
||||
function (field) {
|
||||
if (field.automaticallyOnCard || field.alwaysOnCard)
|
||||
customFieldsArr.push({ _id: field._id, value: null });
|
||||
},
|
||||
);
|
||||
|
||||
const currentCards = Cards.find(
|
||||
{
|
||||
listId: paramListId,
|
||||
|
|
@ -3352,6 +3361,7 @@ if (Meteor.isServer) {
|
|||
swimlaneId: req.body.swimlaneId,
|
||||
sort: currentCards.count(),
|
||||
cardNumber: nextCardNumber,
|
||||
customFields: customFieldsArr,
|
||||
members,
|
||||
assignees,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue