mirror of
https://github.com/zadam/trilium.git
synced 2025-11-14 09:15:50 +01:00
added "delete note revisions" search action
This commit is contained in:
@@ -5,6 +5,7 @@ const SearchContext = require('../../services/search/search_context.js');
|
||||
const log = require('../../services/log');
|
||||
const scriptService = require('../../services/script');
|
||||
const searchService = require('../../services/search/services/search');
|
||||
const noteRevisionService = require("../../services/note_revisions.js");
|
||||
|
||||
async function search(note) {
|
||||
let searchResultNoteIds;
|
||||
@@ -56,9 +57,12 @@ async function searchFromNote(req) {
|
||||
|
||||
const ACTION_HANDLERS = {
|
||||
deleteNote: (action, note) => {
|
||||
note.isDeleted;
|
||||
note.isDeleted = true;
|
||||
note.save();
|
||||
},
|
||||
deleteNoteRevisions: (action, note) => {
|
||||
noteRevisionService.eraseNoteRevisions(note.getRevisions().map(rev => rev.noteRevisionId));
|
||||
},
|
||||
deleteLabel: (action, note) => {
|
||||
for (const label of note.getOwnedLabels(action.labelName)) {
|
||||
label.isDeleted = true;
|
||||
|
||||
Reference in New Issue
Block a user