fix recent notes (db & sync version increase)

This commit is contained in:
zadam
2019-05-21 21:47:28 +02:00
parent ced02b42b5
commit 29828f8e8f
16 changed files with 196 additions and 176 deletions

View File

@@ -28,7 +28,7 @@
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>RecentNote<span class="signature">(branchId, notePath, isDeleted, utcDateModified)</span><span class="type-signature"></span></h2>
<h2><span class="attribs"><span class="type-signature"></span></span>RecentNote<span class="signature">(noteId, notePath, isDeleted, utcDateModified)</span><span class="type-signature"></span></h2>
<div class="class-description">RecentNote represents recently visited note.</div>
@@ -45,7 +45,7 @@
<h4 class="name" id="RecentNote"><span class="type-signature"></span>new RecentNote<span class="signature">(branchId, notePath, isDeleted, utcDateModified)</span><span class="type-signature"></span></h4>
<h4 class="name" id="RecentNote"><span class="type-signature"></span>new RecentNote<span class="signature">(noteId, notePath, isDeleted, utcDateModified)</span><span class="type-signature"></span></h4>
@@ -85,7 +85,7 @@
<tr>
<td class="name"><code>branchId</code></td>
<td class="name"><code>noteId</code></td>
<td class="type">

View File

@@ -34,7 +34,7 @@ const dateUtils = require('../services/date_utils');
/**
* RecentNote represents recently visited note.
*
* @param {string} branchId
* @param {string} noteId
* @param {string} notePath
* @param {boolean} isDeleted
* @param {string} utcDateModified
@@ -43,8 +43,8 @@ const dateUtils = require('../services/date_utils');
*/
class RecentNote extends Entity {
static get entityName() { return "recent_notes"; }
static get primaryKeyName() { return "branchId"; }
static get hashedProperties() { return ["branchId", "notePath", "utcDateCreated", "isDeleted"]; }
static get primaryKeyName() { return "noteId"; }
static get hashedProperties() { return ["noteId", "notePath", "utcDateCreated", "isDeleted"]; }
beforeSaving() {
if (!this.isDeleted) {