mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-01-05 12:29:54 -06:00
25 lines
527 B
JavaScript
25 lines
527 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() {
|
|
super.beforeSaving();
|
|
|
|
if (!this.isDeleted) {
|
|
this.isDeleted = false;
|
|
}
|
|
|
|
if (!this.dateCreated) {
|
|
this.dateCreated = utils.nowDate();
|
|
}
|
|
|
|
this.dateModified = utils.nowDate();
|
|
}
|
|
}
|
|
|
|
module.exports = Image; |