UNPKG

@conveyal/commute

Version:
20 lines (16 loc) 347 B
/** * Don't actually destroy a model */ module.exports = function (schema) { schema.add({ trashed: Date }) schema.methods.trash = function (callback) { this.trashed = new Date() return this.save(callback) } schema.methods.untrash = function (callback) { this.trashed = undefined return this.save(callback) } }