Skip to content

Commit

Permalink
fix restoring note revision, closes #2232
Browse files Browse the repository at this point in the history
  • Loading branch information
zadam committed Oct 15, 2021
1 parent 241d1b1 commit 2cc4367
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/becca/becca.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"use strict";

const sql = require("../services/sql.js");
const NoteRevision = require("./entities/note_revision.js");
const RecentNote = require("./entities/recent_note.js");
const NoteSet = require("../services/search/note_set");

class Becca {
Expand Down Expand Up @@ -102,6 +100,7 @@ class Becca {
getNoteRevision(noteRevisionId) {
const row = sql.getRow("SELECT * FROM note_revisions WHERE noteRevisionId = ?", [noteRevisionId]);

const NoteRevision = require("./entities/note_revision.js"); // avoiding circular dependency problems
return row ? new NoteRevision(row) : null;
}

Expand Down Expand Up @@ -131,12 +130,14 @@ class Becca {
getRecentNotesFromQuery(query, params = []) {
const rows = sql.getRows(query, params);

const RecentNote = require("./entities/recent_note.js"); // avoiding circular dependency problems
return rows.map(row => new RecentNote(row));
}

getNoteRevisionsFromQuery(query, params = []) {
const rows = sql.getRows(query, params);

const NoteRevision = require("./entities/note_revision.js"); // avoiding circular dependency problems
return rows.map(row => new NoteRevision(row));
}

Expand Down

0 comments on commit 2cc4367

Please sign in to comment.