refactoring + uploading attachments WIP

This commit is contained in:
zadam
2023-05-08 00:02:08 +02:00
parent b05ce12e7b
commit 626af84f42
23 changed files with 257 additions and 199 deletions

View File

@@ -2,7 +2,6 @@
const sql = require('../../services/sql');
const becca = require("../../becca/becca");
const NotFoundError = require("../../errors/not_found_error");
function getSchema() {
const tableNames = sql.getColumn(`SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%' ORDER BY name`);
@@ -19,11 +18,7 @@ function getSchema() {
}
function execute(req) {
const note = becca.getNote(req.params.noteId);
if (!note) {
throw new NotFoundError(`Note '${req.params.noteId}' was not found.`);
}
const note = becca.getNoteOrThrow(req.params.noteId);
const queries = note.getContent().split("\n---");