mirror of
https://github.com/zadam/trilium.git
synced 2025-11-08 14:25:51 +01:00
refactoring + uploading attachments WIP
This commit is contained in:
@@ -7,14 +7,9 @@ const bulkActionService = require("../../services/bulk_actions");
|
||||
const cls = require("../../services/cls");
|
||||
const {formatAttrForSearch} = require("../../services/attribute_formatter");
|
||||
const ValidationError = require("../../errors/validation_error");
|
||||
const NotFoundError = require("../../errors/not_found_error");
|
||||
|
||||
function searchFromNote(req) {
|
||||
const note = becca.getNote(req.params.noteId);
|
||||
|
||||
if (!note) {
|
||||
throw new NotFoundError(`Note '${req.params.noteId}' has not been found.`);
|
||||
}
|
||||
const note = becca.getNoteOrThrow(req.params.noteId);
|
||||
|
||||
if (note.isDeleted) {
|
||||
// this can be triggered from recent changes, and it's harmless to return empty list rather than fail
|
||||
@@ -29,11 +24,7 @@ function searchFromNote(req) {
|
||||
}
|
||||
|
||||
function searchAndExecute(req) {
|
||||
const note = becca.getNote(req.params.noteId);
|
||||
|
||||
if (!note) {
|
||||
throw new NotFoundError(`Note '${req.params.noteId}' has not been found.`);
|
||||
}
|
||||
const note = becca.getNoteOrThrow(req.params.noteId);
|
||||
|
||||
if (note.isDeleted) {
|
||||
// this can be triggered from recent changes, and it's harmless to return empty list rather than fail
|
||||
|
||||
Reference in New Issue
Block a user