2022-12-16 16:36:47 +01:00
|
|
|
import { ReactiveCache } from '/imports/reactiveCache';
|
|
|
|
|
|
2018-03-19 00:25:19 -03:00
|
|
|
ChecklistItems = new Mongo.Collection('checklistItems');
|
|
|
|
|
|
2018-10-26 07:27:24 +02:00
|
|
|
/**
|
|
|
|
|
* An item in a checklist
|
|
|
|
|
*/
|
2019-06-26 17:47:27 -05:00
|
|
|
ChecklistItems.attachSchema(
|
|
|
|
|
new SimpleSchema({
|
|
|
|
|
title: {
|
|
|
|
|
/**
|
|
|
|
|
* the text of the item
|
|
|
|
|
*/
|
|
|
|
|
type: String,
|
|
|
|
|
},
|
|
|
|
|
sort: {
|
|
|
|
|
/**
|
|
|
|
|
* the sorting field of the item
|
|
|
|
|
*/
|
|
|
|
|
type: Number,
|
|
|
|
|
decimal: true,
|
|
|
|
|
},
|
|
|
|
|
isFinished: {
|
|
|
|
|
/**
|
|
|
|
|
* Is the item checked?
|
|
|
|
|
*/
|
|
|
|
|
type: Boolean,
|
|
|
|
|
defaultValue: false,
|
|
|
|
|
},
|
|
|
|
|
checklistId: {
|
|
|
|
|
/**
|
|
|
|
|
* the checklist ID the item is attached to
|
|
|
|
|
*/
|
|
|
|
|
type: String,
|
|
|
|
|
},
|
|
|
|
|
cardId: {
|
|
|
|
|
/**
|
|
|
|
|
* the card ID the item is attached to
|
|
|
|
|
*/
|
|
|
|
|
type: String,
|
|
|
|
|
},
|
|
|
|
|
createdAt: {
|
|
|
|
|
type: Date,
|
|
|
|
|
optional: true,
|
|
|
|
|
// eslint-disable-next-line consistent-return
|
|
|
|
|
autoValue() {
|
|
|
|
|
if (this.isInsert) {
|
|
|
|
|
return new Date();
|
2019-09-05 12:29:45 -05:00
|
|
|
} else if (this.isUpsert) {
|
|
|
|
|
return { $setOnInsert: new Date() };
|
2019-06-26 17:47:27 -05:00
|
|
|
} else {
|
|
|
|
|
this.unset();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
modifiedAt: {
|
|
|
|
|
type: Date,
|
|
|
|
|
denyUpdate: false,
|
|
|
|
|
// eslint-disable-next-line consistent-return
|
|
|
|
|
autoValue() {
|
|
|
|
|
if (this.isInsert || this.isUpsert || this.isUpdate) {
|
|
|
|
|
return new Date();
|
|
|
|
|
} else {
|
|
|
|
|
this.unset();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
}),
|
2019-06-26 17:47:27 -05:00
|
|
|
);
|
2018-03-19 00:25:19 -03:00
|
|
|
|
|
|
|
|
ChecklistItems.allow({
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
async insert(userId, doc) {
|
2026-01-14 23:43:11 +02:00
|
|
|
// ReadOnly users cannot create checklist items
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
return allowIsBoardMemberWithWriteAccessByCard(userId, await ReactiveCache.getCard(doc.cardId));
|
2018-03-19 00:25:19 -03:00
|
|
|
},
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
async update(userId, doc) {
|
2026-01-14 23:43:11 +02:00
|
|
|
// ReadOnly users cannot edit checklist items
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
return allowIsBoardMemberWithWriteAccessByCard(userId, await ReactiveCache.getCard(doc.cardId));
|
2018-03-19 00:25:19 -03:00
|
|
|
},
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
async remove(userId, doc) {
|
2026-01-14 23:43:11 +02:00
|
|
|
// ReadOnly users cannot delete checklist items
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
return allowIsBoardMemberWithWriteAccessByCard(userId, await ReactiveCache.getCard(doc.cardId));
|
2018-03-19 00:25:19 -03:00
|
|
|
},
|
|
|
|
|
fetch: ['userId', 'cardId'],
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ChecklistItems.before.insert((userId, doc) => {
|
|
|
|
|
if (!doc.userId) {
|
|
|
|
|
doc.userId = userId;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2026-01-21 19:22:54 +02:00
|
|
|
ChecklistItems.helpers({
|
|
|
|
|
async setTitle(title) {
|
|
|
|
|
return await ChecklistItems.updateAsync(this._id, { $set: { title } });
|
2018-03-19 00:25:19 -03:00
|
|
|
},
|
2026-01-21 19:22:54 +02:00
|
|
|
async check() {
|
|
|
|
|
return await ChecklistItems.updateAsync(this._id, { $set: { isFinished: true } });
|
2018-08-19 18:53:50 +02:00
|
|
|
},
|
2026-01-21 19:22:54 +02:00
|
|
|
async uncheck() {
|
|
|
|
|
return await ChecklistItems.updateAsync(this._id, { $set: { isFinished: false } });
|
2018-08-19 18:53:50 +02:00
|
|
|
},
|
2026-01-21 19:22:54 +02:00
|
|
|
async toggleItem() {
|
|
|
|
|
return await ChecklistItems.updateAsync(this._id, { $set: { isFinished: !this.isFinished } });
|
2018-03-19 00:25:19 -03:00
|
|
|
},
|
2026-01-21 19:22:54 +02:00
|
|
|
async move(checklistId, sortIndex) {
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
const checklist = await ReactiveCache.getChecklist(checklistId);
|
|
|
|
|
const cardId = checklist.cardId;
|
2026-01-21 19:22:54 +02:00
|
|
|
return await ChecklistItems.updateAsync(this._id, {
|
|
|
|
|
$set: { cardId, checklistId, sort: sortIndex },
|
|
|
|
|
});
|
2018-03-19 17:31:53 -03:00
|
|
|
},
|
2018-03-19 00:25:19 -03:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Activities helper
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
async function itemCreation(userId, doc) {
|
|
|
|
|
const card = await ReactiveCache.getCard(doc.cardId);
|
2018-03-19 00:25:19 -03:00
|
|
|
const boardId = card.boardId;
|
|
|
|
|
Activities.insert({
|
|
|
|
|
userId,
|
|
|
|
|
activityType: 'addChecklistItem',
|
|
|
|
|
cardId: doc.cardId,
|
|
|
|
|
boardId,
|
|
|
|
|
checklistId: doc.checklistId,
|
|
|
|
|
checklistItemId: doc._id,
|
2019-06-27 04:06:21 +03:00
|
|
|
checklistItemName: doc.title,
|
|
|
|
|
listId: card.listId,
|
|
|
|
|
swimlaneId: card.swimlaneId,
|
2018-03-19 00:25:19 -03:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function itemRemover(userId, doc) {
|
|
|
|
|
Activities.remove({
|
|
|
|
|
checklistItemId: doc._id,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
async function publishCheckActivity(userId, doc) {
|
|
|
|
|
const card = await ReactiveCache.getCard(doc.cardId);
|
2018-08-16 21:49:56 +02:00
|
|
|
const boardId = card.boardId;
|
|
|
|
|
let activityType;
|
2019-06-26 17:47:27 -05:00
|
|
|
if (doc.isFinished) {
|
2018-09-16 01:50:36 +03:00
|
|
|
activityType = 'checkedItem';
|
2019-06-26 17:47:27 -05:00
|
|
|
} else {
|
2018-09-16 01:50:36 +03:00
|
|
|
activityType = 'uncheckedItem';
|
2018-08-16 21:49:56 +02:00
|
|
|
}
|
2018-09-16 01:50:36 +03:00
|
|
|
const act = {
|
2018-08-16 21:49:56 +02:00
|
|
|
userId,
|
2018-09-16 01:50:36 +03:00
|
|
|
activityType,
|
2018-08-16 21:49:56 +02:00
|
|
|
cardId: doc.cardId,
|
|
|
|
|
boardId,
|
|
|
|
|
checklistId: doc.checklistId,
|
|
|
|
|
checklistItemId: doc._id,
|
2019-06-26 17:47:27 -05:00
|
|
|
checklistItemName: doc.title,
|
2019-06-27 04:06:21 +03:00
|
|
|
listId: card.listId,
|
|
|
|
|
swimlaneId: card.swimlaneId,
|
2018-09-16 01:50:36 +03:00
|
|
|
};
|
2018-08-16 21:49:56 +02:00
|
|
|
Activities.insert(act);
|
|
|
|
|
}
|
|
|
|
|
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
async function publishChekListCompleted(userId, doc) {
|
|
|
|
|
const card = await ReactiveCache.getCard(doc.cardId);
|
2018-08-16 21:49:56 +02:00
|
|
|
const boardId = card.boardId;
|
|
|
|
|
const checklistId = doc.checklistId;
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
const checkList = await ReactiveCache.getChecklist(checklistId);
|
2026-02-18 18:24:55 +02:00
|
|
|
const checklistItems = await ReactiveCache.getChecklistItems({ checklistId });
|
|
|
|
|
const isChecklistFinished = checkList.hideAllChecklistItems ||
|
|
|
|
|
(checklistItems.length > 0 && checklistItems.length === checklistItems.filter(i => i.isFinished).length);
|
|
|
|
|
if (isChecklistFinished) {
|
2018-09-16 01:50:36 +03:00
|
|
|
const act = {
|
2018-08-16 21:49:56 +02:00
|
|
|
userId,
|
2018-12-05 15:21:24 +02:00
|
|
|
activityType: 'completeChecklist',
|
2018-08-16 21:49:56 +02:00
|
|
|
cardId: doc.cardId,
|
|
|
|
|
boardId,
|
|
|
|
|
checklistId: doc.checklistId,
|
2018-10-08 00:44:02 +03:00
|
|
|
checklistName: checkList.title,
|
2019-06-27 04:06:21 +03:00
|
|
|
listId: card.listId,
|
|
|
|
|
swimlaneId: card.swimlaneId,
|
2018-09-16 01:50:36 +03:00
|
|
|
};
|
2018-08-16 21:49:56 +02:00
|
|
|
Activities.insert(act);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
async function publishChekListUncompleted(userId, doc) {
|
|
|
|
|
const card = await ReactiveCache.getCard(doc.cardId);
|
2018-08-16 21:49:56 +02:00
|
|
|
const boardId = card.boardId;
|
|
|
|
|
const checklistId = doc.checklistId;
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
const checkList = await ReactiveCache.getChecklist(checklistId);
|
2018-12-06 01:49:57 +02:00
|
|
|
// BUGS in IFTTT Rules: https://github.com/wekan/wekan/issues/1972
|
|
|
|
|
// Currently in checklist all are set as uncompleted/not checked,
|
|
|
|
|
// IFTTT Rule does not move card to other list.
|
|
|
|
|
// If following line is negated/changed to:
|
2026-02-18 18:24:55 +02:00
|
|
|
// if(!isChecklistFinished){
|
2018-12-06 01:49:57 +02:00
|
|
|
// then unchecking of any checkbox will move card to other list,
|
|
|
|
|
// even when all checkboxes are not yet unchecked.
|
|
|
|
|
// What is correct code for only moving when all in list is unchecked?
|
|
|
|
|
// TIPS: Finding files, ignoring some directories with grep -v:
|
|
|
|
|
// cd wekan
|
|
|
|
|
// find . | xargs grep 'count' -sl | grep -v .meteor | grep -v node_modules | grep -v .build
|
|
|
|
|
// Maybe something related here?
|
|
|
|
|
// wekan/client/components/rules/triggers/checklistTriggers.js
|
2026-02-18 18:24:55 +02:00
|
|
|
const uncheckItems = await ReactiveCache.getChecklistItems({ checklistId });
|
|
|
|
|
const isChecklistFinished = checkList.hideAllChecklistItems ||
|
|
|
|
|
(uncheckItems.length > 0 && uncheckItems.length === uncheckItems.filter(i => i.isFinished).length);
|
|
|
|
|
if (isChecklistFinished) {
|
2018-09-16 01:50:36 +03:00
|
|
|
const act = {
|
2018-08-16 21:49:56 +02:00
|
|
|
userId,
|
2018-12-06 01:49:57 +02:00
|
|
|
activityType: 'uncompleteChecklist',
|
2018-08-16 21:49:56 +02:00
|
|
|
cardId: doc.cardId,
|
|
|
|
|
boardId,
|
|
|
|
|
checklistId: doc.checklistId,
|
2018-10-08 00:44:02 +03:00
|
|
|
checklistName: checkList.title,
|
2019-06-27 04:06:21 +03:00
|
|
|
listId: card.listId,
|
|
|
|
|
swimlaneId: card.swimlaneId,
|
2018-09-16 01:50:36 +03:00
|
|
|
};
|
2018-08-16 21:49:56 +02:00
|
|
|
Activities.insert(act);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-19 00:25:19 -03:00
|
|
|
// Activities
|
|
|
|
|
if (Meteor.isServer) {
|
2026-01-24 01:55:29 +02:00
|
|
|
Meteor.startup(async () => {
|
|
|
|
|
await ChecklistItems._collection.createIndexAsync({ modifiedAt: -1 });
|
|
|
|
|
await ChecklistItems._collection.createIndexAsync({ checklistId: 1 });
|
|
|
|
|
await ChecklistItems._collection.createIndexAsync({ cardId: 1 });
|
2018-03-19 00:25:19 -03:00
|
|
|
});
|
|
|
|
|
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
ChecklistItems.after.update(async (userId, doc, fieldNames) => {
|
|
|
|
|
await publishCheckActivity(userId, doc);
|
|
|
|
|
await publishChekListCompleted(userId, doc, fieldNames);
|
2018-08-16 21:49:56 +02:00
|
|
|
});
|
|
|
|
|
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
ChecklistItems.before.update(async (userId, doc, fieldNames) => {
|
|
|
|
|
await publishChekListUncompleted(userId, doc, fieldNames);
|
2018-08-16 21:49:56 +02:00
|
|
|
});
|
|
|
|
|
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
ChecklistItems.after.insert(async (userId, doc) => {
|
|
|
|
|
await itemCreation(userId, doc);
|
2018-03-19 00:25:19 -03:00
|
|
|
});
|
|
|
|
|
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
ChecklistItems.before.remove(async (userId, doc) => {
|
2018-03-19 00:25:19 -03:00
|
|
|
itemRemover(userId, doc);
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
const card = await ReactiveCache.getCard(doc.cardId);
|
2019-03-08 21:13:41 +01:00
|
|
|
const boardId = card.boardId;
|
|
|
|
|
Activities.insert({
|
|
|
|
|
userId,
|
|
|
|
|
activityType: 'removedChecklistItem',
|
|
|
|
|
cardId: doc.cardId,
|
|
|
|
|
boardId,
|
|
|
|
|
checklistId: doc.checklistId,
|
|
|
|
|
checklistItemId: doc._id,
|
2019-06-26 17:47:27 -05:00
|
|
|
checklistItemName: doc.title,
|
2019-06-27 04:06:21 +03:00
|
|
|
listId: card.listId,
|
|
|
|
|
swimlaneId: card.swimlaneId,
|
2019-03-08 21:13:41 +01:00
|
|
|
});
|
2018-03-19 00:25:19 -03:00
|
|
|
});
|
|
|
|
|
}
|
2018-04-15 23:05:47 -03:00
|
|
|
|
|
|
|
|
if (Meteor.isServer) {
|
2018-10-26 07:27:24 +02:00
|
|
|
/**
|
|
|
|
|
* @operation get_checklist_item
|
|
|
|
|
* @tag Checklists
|
|
|
|
|
* @summary Get a checklist item
|
|
|
|
|
*
|
|
|
|
|
* @param {string} boardId the board ID
|
|
|
|
|
* @param {string} cardId the card ID
|
|
|
|
|
* @param {string} checklistId the checklist ID
|
|
|
|
|
* @param {string} itemId the ID of the item
|
|
|
|
|
* @return_type ChecklistItems
|
|
|
|
|
*/
|
2019-06-26 17:47:27 -05:00
|
|
|
JsonRoutes.add(
|
|
|
|
|
'GET',
|
|
|
|
|
'/api/boards/:boardId/cards/:cardId/checklists/:checklistId/items/:itemId',
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
async function(req, res) {
|
2021-06-14 15:01:37 +03:00
|
|
|
const paramBoardId = req.params.boardId;
|
2026-01-18 19:13:14 +02:00
|
|
|
const paramCardId = req.params.cardId;
|
|
|
|
|
const paramChecklistId = req.params.checklistId;
|
2019-06-26 17:47:27 -05:00
|
|
|
const paramItemId = req.params.itemId;
|
2023-01-13 21:50:39 +02:00
|
|
|
Authentication.checkBoardAccess(req.userId, paramBoardId);
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
const checklistItem = await ReactiveCache.getChecklistItem(paramItemId);
|
2026-01-18 19:13:14 +02:00
|
|
|
if (checklistItem && checklistItem.cardId === paramCardId && checklistItem.checklistId === paramChecklistId) {
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
const card = await ReactiveCache.getCard(checklistItem.cardId);
|
2026-01-18 19:13:14 +02:00
|
|
|
if (card && card.boardId === paramBoardId) {
|
|
|
|
|
JsonRoutes.sendResult(res, {
|
|
|
|
|
code: 200,
|
|
|
|
|
data: checklistItem,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
JsonRoutes.sendResult(res, {
|
|
|
|
|
code: 404,
|
|
|
|
|
});
|
|
|
|
|
}
|
2019-06-26 17:47:27 -05:00
|
|
|
} else {
|
|
|
|
|
JsonRoutes.sendResult(res, {
|
2026-01-18 19:13:14 +02:00
|
|
|
code: 404,
|
2019-06-26 17:47:27 -05:00
|
|
|
});
|
|
|
|
|
}
|
2019-06-28 12:52:09 -05:00
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
);
|
2018-04-15 23:05:47 -03:00
|
|
|
|
2023-05-15 23:43:42 +03:00
|
|
|
/**
|
|
|
|
|
* @operation new_checklist_item
|
|
|
|
|
* @summary add a new item to a checklist
|
|
|
|
|
*
|
|
|
|
|
* @param {string} boardId the board ID
|
|
|
|
|
* @param {string} cardId the card ID
|
|
|
|
|
* @param {string} checklistId the ID of the checklist
|
|
|
|
|
* @param {string} title the title of the new item
|
|
|
|
|
* @return_type {_id: string}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
JsonRoutes.add(
|
|
|
|
|
'POST',
|
|
|
|
|
'/api/boards/:boardId/cards/:cardId/checklists/:checklistId/items',
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
async function(req, res) {
|
2023-05-15 23:43:42 +03:00
|
|
|
const paramBoardId = req.params.boardId;
|
|
|
|
|
const paramChecklistId = req.params.checklistId;
|
|
|
|
|
const paramCardId = req.params.cardId;
|
|
|
|
|
Authentication.checkBoardAccess(req.userId, paramBoardId);
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
const checklist = await ReactiveCache.getChecklist({
|
2023-05-15 23:43:42 +03:00
|
|
|
_id: paramChecklistId,
|
|
|
|
|
cardId: paramCardId,
|
|
|
|
|
});
|
|
|
|
|
if (checklist) {
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
const card = await ReactiveCache.getCard(paramCardId);
|
2026-01-18 19:13:14 +02:00
|
|
|
if (card && card.boardId === paramBoardId) {
|
|
|
|
|
const id = ChecklistItems.insert({
|
|
|
|
|
cardId: paramCardId,
|
|
|
|
|
checklistId: paramChecklistId,
|
|
|
|
|
title: req.body.title,
|
|
|
|
|
isFinished: false,
|
|
|
|
|
sort: 0,
|
|
|
|
|
});
|
|
|
|
|
JsonRoutes.sendResult(res, {
|
|
|
|
|
code: 200,
|
|
|
|
|
data: {
|
|
|
|
|
_id: id,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
JsonRoutes.sendResult(res, {
|
|
|
|
|
code: 404,
|
|
|
|
|
});
|
|
|
|
|
}
|
2023-05-15 23:43:42 +03:00
|
|
|
} else {
|
|
|
|
|
JsonRoutes.sendResult(res, {
|
|
|
|
|
code: 404,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
2018-10-26 07:27:24 +02:00
|
|
|
/**
|
|
|
|
|
* @operation edit_checklist_item
|
|
|
|
|
* @tag Checklists
|
|
|
|
|
* @summary Edit a checklist item
|
|
|
|
|
*
|
|
|
|
|
* @param {string} boardId the board ID
|
|
|
|
|
* @param {string} cardId the card ID
|
|
|
|
|
* @param {string} checklistId the checklist ID
|
|
|
|
|
* @param {string} itemId the ID of the item
|
|
|
|
|
* @param {string} [isFinished] is the item checked?
|
|
|
|
|
* @param {string} [title] the new text of the item
|
|
|
|
|
* @return_type {_id: string}
|
|
|
|
|
*/
|
2019-06-26 17:47:27 -05:00
|
|
|
JsonRoutes.add(
|
|
|
|
|
'PUT',
|
|
|
|
|
'/api/boards/:boardId/cards/:cardId/checklists/:checklistId/items/:itemId',
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
async function(req, res) {
|
2021-06-14 15:01:37 +03:00
|
|
|
const paramBoardId = req.params.boardId;
|
2026-01-18 19:13:14 +02:00
|
|
|
const paramCardId = req.params.cardId;
|
|
|
|
|
const paramChecklistId = req.params.checklistId;
|
2019-06-26 17:47:27 -05:00
|
|
|
const paramItemId = req.params.itemId;
|
2023-01-13 21:50:39 +02:00
|
|
|
Authentication.checkBoardAccess(req.userId, paramBoardId);
|
2018-04-15 23:05:47 -03:00
|
|
|
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
const checklistItem = await ReactiveCache.getChecklistItem(paramItemId);
|
2026-01-18 19:13:14 +02:00
|
|
|
if (!checklistItem || checklistItem.cardId !== paramCardId || checklistItem.checklistId !== paramChecklistId) {
|
|
|
|
|
JsonRoutes.sendResult(res, {
|
|
|
|
|
code: 404,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
const card = await ReactiveCache.getCard(checklistItem.cardId);
|
2026-01-18 19:13:14 +02:00
|
|
|
if (!card || card.boardId !== paramBoardId) {
|
|
|
|
|
JsonRoutes.sendResult(res, {
|
|
|
|
|
code: 404,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-17 16:24:27 +02:00
|
|
|
function isTrue(data) {
|
|
|
|
|
try {
|
|
|
|
|
return data.toLowerCase() === 'true';
|
|
|
|
|
} catch (error) {
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-26 17:47:27 -05:00
|
|
|
if (req.body.hasOwnProperty('isFinished')) {
|
|
|
|
|
ChecklistItems.direct.update(
|
|
|
|
|
{ _id: paramItemId },
|
2020-07-17 16:24:27 +02:00
|
|
|
{ $set: { isFinished: isTrue(req.body.isFinished) } },
|
2019-06-26 17:47:27 -05:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
if (req.body.hasOwnProperty('title')) {
|
|
|
|
|
ChecklistItems.direct.update(
|
|
|
|
|
{ _id: paramItemId },
|
2019-06-28 12:52:09 -05:00
|
|
|
{ $set: { title: req.body.title } },
|
2019-06-26 17:47:27 -05:00
|
|
|
);
|
|
|
|
|
}
|
2018-04-15 23:05:47 -03:00
|
|
|
|
2019-06-26 17:47:27 -05:00
|
|
|
JsonRoutes.sendResult(res, {
|
|
|
|
|
code: 200,
|
|
|
|
|
data: {
|
|
|
|
|
_id: paramItemId,
|
|
|
|
|
},
|
|
|
|
|
});
|
2019-06-28 12:52:09 -05:00
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
);
|
2018-04-15 23:05:47 -03:00
|
|
|
|
2018-10-26 07:27:24 +02:00
|
|
|
/**
|
|
|
|
|
* @operation delete_checklist_item
|
|
|
|
|
* @tag Checklists
|
|
|
|
|
* @summary Delete a checklist item
|
|
|
|
|
*
|
|
|
|
|
* @description Note: this operation can't be reverted.
|
|
|
|
|
*
|
|
|
|
|
* @param {string} boardId the board ID
|
|
|
|
|
* @param {string} cardId the card ID
|
|
|
|
|
* @param {string} checklistId the checklist ID
|
|
|
|
|
* @param {string} itemId the ID of the item to be removed
|
|
|
|
|
* @return_type {_id: string}
|
|
|
|
|
*/
|
2019-06-26 17:47:27 -05:00
|
|
|
JsonRoutes.add(
|
|
|
|
|
'DELETE',
|
|
|
|
|
'/api/boards/:boardId/cards/:cardId/checklists/:checklistId/items/:itemId',
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
async function(req, res) {
|
2021-06-14 15:01:37 +03:00
|
|
|
const paramBoardId = req.params.boardId;
|
2026-01-18 19:13:14 +02:00
|
|
|
const paramCardId = req.params.cardId;
|
|
|
|
|
const paramChecklistId = req.params.checklistId;
|
2019-06-26 17:47:27 -05:00
|
|
|
const paramItemId = req.params.itemId;
|
2023-01-13 21:50:39 +02:00
|
|
|
Authentication.checkBoardAccess(req.userId, paramBoardId);
|
2026-01-18 19:13:14 +02:00
|
|
|
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
const checklistItem = await ReactiveCache.getChecklistItem(paramItemId);
|
2026-01-18 19:13:14 +02:00
|
|
|
if (!checklistItem || checklistItem.cardId !== paramCardId || checklistItem.checklistId !== paramChecklistId) {
|
|
|
|
|
JsonRoutes.sendResult(res, {
|
|
|
|
|
code: 404,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async
Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
checklists, checklistItems, customFields, attachments, integrations,
cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
2026-02-01 00:54:38 +02:00
|
|
|
const card = await ReactiveCache.getCard(checklistItem.cardId);
|
2026-01-18 19:13:14 +02:00
|
|
|
if (!card || card.boardId !== paramBoardId) {
|
|
|
|
|
JsonRoutes.sendResult(res, {
|
|
|
|
|
code: 404,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-26 17:47:27 -05:00
|
|
|
ChecklistItems.direct.remove({ _id: paramItemId });
|
|
|
|
|
JsonRoutes.sendResult(res, {
|
|
|
|
|
code: 200,
|
|
|
|
|
data: {
|
|
|
|
|
_id: paramItemId,
|
|
|
|
|
},
|
|
|
|
|
});
|
2019-06-28 12:52:09 -05:00
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
);
|
2018-04-15 23:05:47 -03:00
|
|
|
}
|
2019-06-26 17:47:27 -05:00
|
|
|
|
|
|
|
|
export default ChecklistItems;
|