mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 20:45:00 -05:00
23 lines
495 B
JavaScript
23 lines
495 B
JavaScript
import { ReactiveCache } from '/imports/reactiveCache';
|
|
import { Mongo } from 'meteor/mongo';
|
|
|
|
const Actions = new Mongo.Collection('actions');
|
|
|
|
Actions.before.insert((userId, doc) => {
|
|
doc.createdAt = new Date();
|
|
doc.modifiedAt = doc.createdAt;
|
|
});
|
|
|
|
Actions.before.update((userId, doc, fieldNames, modifier) => {
|
|
modifier.$set = modifier.$set || {};
|
|
modifier.$set.modifiedAt = new Date();
|
|
});
|
|
|
|
Actions.helpers({
|
|
description() {
|
|
return this.desc;
|
|
},
|
|
});
|
|
|
|
export default Actions;
|