mirror of
https://github.com/wekan/wekan.git
synced 2025-04-20 12:07:11 -04:00
Merge branch 'fix-checklist' of https://github.com/nztqa/wekan into nztqa-fix-checklist
This commit is contained in:
commit
5854805bdc
1 changed files with 7 additions and 1 deletions
|
@ -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