building.js
375 Bytes
'use strict';
import Model from './model';
class Building extends Model {
constructor() {
super('buildings');
}
async updateState(id, state) {
await this.update({
_id: id
}, {
$set: {
state: state,
updatedAt: new Date()
}
});
}
}
export default Building;