mirror of
https://github.com/wekan/wekan.git
synced 2025-12-20 09:20:12 +01:00
fix cardnumber assignment for moved or copied card
This commit is contained in:
parent
e8522c323f
commit
2fd741bf54
1 changed files with 5 additions and 0 deletions
|
|
@ -577,6 +577,7 @@ Cards.helpers({
|
||||||
|
|
||||||
delete this._id;
|
delete this._id;
|
||||||
this.boardId = boardId;
|
this.boardId = boardId;
|
||||||
|
this.cardNumber = Boards.findOne(boardId).getNextCardNumber();
|
||||||
this.swimlaneId = swimlaneId;
|
this.swimlaneId = swimlaneId;
|
||||||
this.listId = listId;
|
this.listId = listId;
|
||||||
const _id = Cards.insert(this);
|
const _id = Cards.insert(this);
|
||||||
|
|
@ -1989,8 +1990,12 @@ Cards.mutations({
|
||||||
'_id',
|
'_id',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// assign the new card number from the target board
|
||||||
|
const newCardNumber = newBoard.getNextCardNumber();
|
||||||
|
|
||||||
Object.assign(mutatedFields, {
|
Object.assign(mutatedFields, {
|
||||||
labelIds: newCardLabelIds,
|
labelIds: newCardLabelIds,
|
||||||
|
cardNumber: newCardNumber
|
||||||
});
|
});
|
||||||
|
|
||||||
mutatedFields.customFields = this.mapCustomFieldsToBoard(newBoard._id);
|
mutatedFields.customFields = this.mapCustomFieldsToBoard(newBoard._id);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue