mirror of
https://github.com/wekan/wekan.git
synced 2026-02-04 07:31:47 +01:00
Fix async/await in copy/move card operations
The mapCustomFieldsToBoard() method is async but was being called without await in copy() and move() methods. This caused a Promise to be assigned to customFields instead of the actual array, failing MongoDB schema validation on cross-board operations. Changes: - Make copy() method async and await mapCustomFieldsToBoard() - Add await in move() for mapCustomFieldsToBoard() - Make copyCard() server method async and await card.copy() - Add null check in mapCustomFieldsToBoard() for cards without custom fields - Update client to use Meteor.callAsync for server-only copyCard method Fixes #6105
This commit is contained in:
parent
88b35a6415
commit
14de981ac3
2 changed files with 11 additions and 7 deletions
|
|
@ -1050,7 +1050,7 @@ Template.editCardAssignerForm.events({
|
|||
const title = textarea.val().trim();
|
||||
|
||||
if (title) {
|
||||
const newCardId = Meteor.call('copyCard', card._id, options.boardId, options.swimlaneId, options.listId, true, {title: title});
|
||||
const newCardId = await Meteor.callAsync('copyCard', card._id, options.boardId, options.swimlaneId, options.listId, true, {title: title});
|
||||
|
||||
// Position the copied card
|
||||
if (newCardId) {
|
||||
|
|
@ -1145,7 +1145,7 @@ Template.editCardAssignerForm.events({
|
|||
if (title) {
|
||||
const titleList = JSON.parse(title);
|
||||
for (const obj of titleList) {
|
||||
const newCardId = Meteor.call('copyCard', card._id, options.boardId, options.swimlaneId, options.listId, false, {title: obj.title, description: obj.description});
|
||||
const newCardId = await Meteor.callAsync('copyCard', card._id, options.boardId, options.swimlaneId, options.listId, false, {title: obj.title, description: obj.description});
|
||||
|
||||
// Position the copied card
|
||||
if (newCardId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue