mirror of
https://github.com/wekan/wekan.git
synced 2025-04-20 12:07:11 -04:00
Merge branch 'nztqa-fix-checklist' into devel
Fix duplicate id generation. Thanks to nztqa ! Closes #1090
This commit is contained in:
commit
b0367491b9
2 changed files with 9 additions and 2 deletions
|
@ -7,7 +7,8 @@ This release adds the following new features:
|
|||
and fixes the following bugs:
|
||||
|
||||
* [Fix incorrect attachment link with subfolder in the url](https://github.com/wekan/wekan/pull/1086);
|
||||
* [Fix link to card](https://github.com/wekan/wekan/pull/1087).
|
||||
* [Fix link to card](https://github.com/wekan/wekan/pull/1087);
|
||||
* [Fix duplicate id generation](https://github.com/wekan/wekan/pull/1093).
|
||||
|
||||
Thanks to GitHub users kubiko and nztqa for their contributions.
|
||||
|
||||
|
|
|
@ -86,7 +86,13 @@ Checklists.mutations({
|
|||
//for items in checklist
|
||||
addItem(title) {
|
||||
const itemCount = this.itemCount();
|
||||
const _id = `${this._id}${itemCount}`;
|
||||
let idx = 0;
|
||||
if (itemCount > 0) {
|
||||
const lastId = this.items[itemCount - 1]._id;
|
||||
const lastIdSuffix = lastId.substr(this._id.length);
|
||||
idx = parseInt(lastIdSuffix, 10) + 1;
|
||||
}
|
||||
const _id = `${this._id}${idx}`;
|
||||
return { $addToSet: { items: { _id, title, isFinished: false } } };
|
||||
},
|
||||
removeItem(itemId) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue