mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
v3: misc fixes
This commit is contained in:
@@ -32,6 +32,10 @@ module.exports = function baseModel (schema, options = {}) {
|
||||
if (!this.isNew) this.updatedAt = Date.now();
|
||||
next();
|
||||
});
|
||||
|
||||
schema.pre('update', function preUpdateModel () {
|
||||
this.update({}, { $set: { updatedAt: new Date() } });
|
||||
});
|
||||
}
|
||||
|
||||
let noSetFields = ['createdAt', 'updatedAt'];
|
||||
|
||||
Reference in New Issue
Block a user