mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 22:05:44 +01:00
added rename note bulk action
This commit is contained in:
@@ -4,6 +4,8 @@ const becca = require("../becca/becca");
|
||||
const cloningService = require("./cloning");
|
||||
const branchService = require("./branches");
|
||||
const utils = require("./utils");
|
||||
const dayjs = require("dayjs");
|
||||
const cls = require("./cls.js");
|
||||
|
||||
const ACTION_HANDLERS = {
|
||||
addLabel: (action, note) => {
|
||||
@@ -30,6 +32,17 @@ const ACTION_HANDLERS = {
|
||||
relation.markAsDeleted();
|
||||
}
|
||||
},
|
||||
renameNote: (action, note) => {
|
||||
// "officially" injected value:
|
||||
// - note
|
||||
|
||||
const newTitle = eval('`' + action.newTitle + '`');
|
||||
|
||||
if (note.title !== newTitle) {
|
||||
note.title = newTitle;
|
||||
note.save();
|
||||
}
|
||||
},
|
||||
renameLabel: (action, note) => {
|
||||
for (const label of note.getOwnedLabels(action.oldLabelName)) {
|
||||
// attribute name is immutable, renaming means delete old + create new
|
||||
|
||||
Reference in New Issue
Block a user