mirror of
https://github.com/zadam/trilium.git
synced 2024-11-15 20:33:12 +08:00
27 lines
No EOL
583 B
JavaScript
27 lines
No EOL
583 B
JavaScript
"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() {
|
|
if (!this.imageId) {
|
|
this.imageId = utils.newImageId();
|
|
}
|
|
|
|
if (!this.isDeleted) {
|
|
this.isDeleted = false;
|
|
}
|
|
|
|
if (!this.dateCreated) {
|
|
this.dateCreated = utils.nowDate();
|
|
}
|
|
|
|
this.dateModified = utils.nowDate();
|
|
}
|
|
}
|
|
|
|
module.exports = Image; |