mirror of
https://github.com/wekan/wekan.git
synced 2026-03-06 13:50:16 +01:00
Replace mquandalle:collection-mutations with collection helpers
This commit is contained in:
parent
aca661583d
commit
94a3575e2c
35 changed files with 718 additions and 1321 deletions
|
|
@ -3,16 +3,6 @@ import { Meteor } from 'meteor/meteor';
|
|||
|
||||
Triggers = new Mongo.Collection('triggers');
|
||||
|
||||
Triggers.mutations({
|
||||
rename(description) {
|
||||
return {
|
||||
$set: {
|
||||
description,
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
Triggers.before.insert((userId, doc) => {
|
||||
doc.createdAt = new Date();
|
||||
doc.updatedAt = doc.createdAt;
|
||||
|
|
@ -36,6 +26,12 @@ Triggers.allow({
|
|||
});
|
||||
|
||||
Triggers.helpers({
|
||||
async rename(description) {
|
||||
return await Triggers.updateAsync(this._id, {
|
||||
$set: { description },
|
||||
});
|
||||
},
|
||||
|
||||
description() {
|
||||
return this.desc;
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue