summaryrefslogtreecommitdiffstats
path: root/models/checklists.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-06-29 07:47:57 -0400
committerLauri Ojansivu <x@xet7.org>2019-06-29 07:47:57 -0400
commitb84dc20ded0375d9ab14ec05c78b737398d76b83 (patch)
treec3b91b3657299c779e941a1257df17bb0eade866 /models/checklists.js
parent100288b3e1bce882ab9923a5bff7b5f620f33ee8 (diff)
parent3eb4d2c341b712268bd321173909e0a7b19a88c9 (diff)
downloadwekan-b84dc20ded0375d9ab14ec05c78b737398d76b83.tar.gz
wekan-b84dc20ded0375d9ab14ec05c78b737398d76b83.tar.bz2
wekan-b84dc20ded0375d9ab14ec05c78b737398d76b83.zip
Merge branch 'linting' of https://github.com/justinr1234/wekan into justinr1234-linting
Diffstat (limited to 'models/checklists.js')
-rw-r--r--models/checklists.js23
1 files changed, 9 insertions, 14 deletions
diff --git a/models/checklists.js b/models/checklists.js
index 6fd22702..f139192e 100644
--- a/models/checklists.js
+++ b/models/checklists.js
@@ -59,7 +59,7 @@ Checklists.attachSchema(
type: Number,
decimal: true,
},
- })
+ }),
);
Checklists.helpers({
@@ -68,7 +68,7 @@ Checklists.helpers({
this._id = null;
this.cardId = newCardId;
const newChecklistId = Checklists.insert(this);
- ChecklistItems.find({ checklistId: oldChecklistId }).forEach((item) => {
+ ChecklistItems.find({ checklistId: oldChecklistId }).forEach(item => {
item._id = null;
item.checklistId = newChecklistId;
item.cardId = newCardId;
@@ -84,7 +84,7 @@ Checklists.helpers({
{
checklistId: this._id,
},
- { sort: ['sort'] }
+ { sort: ['sort'] },
);
},
finishedCount() {
@@ -160,16 +160,11 @@ if (Meteor.isServer) {
});
});
- Checklists.before.update((userId, doc, fieldNames, modifier, options) => {
- modifier.$set = modifier.$set || {};
- modifier.$set.modifiedAt = Date.now();
- });
-
Checklists.before.remove((userId, doc) => {
const activities = Activities.find({ checklistId: doc._id });
const card = Cards.findOne(doc.cardId);
if (activities) {
- activities.forEach((activity) => {
+ activities.forEach(activity => {
Activities.remove(activity._id);
});
}
@@ -203,7 +198,7 @@ if (Meteor.isServer) {
Authentication.checkUserId(req.userId);
const paramCardId = req.params.cardId;
const checklists = Checklists.find({ cardId: paramCardId }).map(function(
- doc
+ doc,
) {
return {
_id: doc._id,
@@ -220,7 +215,7 @@ if (Meteor.isServer) {
code: 500,
});
}
- }
+ },
);
/**
@@ -269,7 +264,7 @@ if (Meteor.isServer) {
code: 500,
});
}
- }
+ },
);
/**
@@ -313,7 +308,7 @@ if (Meteor.isServer) {
code: 400,
});
}
- }
+ },
);
/**
@@ -340,7 +335,7 @@ if (Meteor.isServer) {
_id: paramChecklistId,
},
});
- }
+ },
);
}