mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
36 lines
851 B
JavaScript
36 lines
851 B
JavaScript
"use strict";
|
|
|
|
const dateUtils = require('../../services/date_utils');
|
|
const AbstractEntity = require("./abstract_entity");
|
|
|
|
/**
|
|
* RecentNote represents recently visited note.
|
|
*
|
|
* @extends AbstractEntity
|
|
*/
|
|
class RecentNote extends AbstractEntity {
|
|
static get entityName() { return "recent_notes"; }
|
|
static get primaryKeyName() { return "noteId"; }
|
|
|
|
constructor(row) {
|
|
super();
|
|
|
|
/** @type {string} */
|
|
this.noteId = row.noteId;
|
|
/** @type {string} */
|
|
this.notePath = row.notePath;
|
|
/** @type {string} */
|
|
this.utcDateCreated = row.utcDateCreated || dateUtils.utcNowDateTime();
|
|
}
|
|
|
|
getPojo() {
|
|
return {
|
|
noteId: this.noteId,
|
|
notePath: this.notePath,
|
|
utcDateCreated: this.utcDateCreated
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = RecentNote;
|