trilium/src/entities/image.js

25 lines
527 B
JavaScript
Raw Normal View History

"use strict";
const Entity = require('./entity');
const utils = require('../services/utils');
class Image extends Entity {
static get tableName() { return "images"; }
static get primaryKeyName() { return "imageId"; }
beforeSaving() {
2018-04-03 08:30:00 +08:00
super.beforeSaving();
2018-04-02 05:38:24 +08:00
if (!this.isDeleted) {
this.isDeleted = false;
}
if (!this.dateCreated) {
this.dateCreated = utils.nowDate();
}
this.dateModified = utils.nowDate();
}
}
module.exports = Image;