mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fix putting new attribute correctly into becca
This commit is contained in:
parent
540aba39db
commit
5ca7e39852
@ -44,7 +44,7 @@ export default class ExecuteScriptBulkAction extends AbstractBulkAction {
|
|||||||
|
|
||||||
const spacedUpdate = new SpacedUpdate(async () => {
|
const spacedUpdate = new SpacedUpdate(async () => {
|
||||||
await this.saveAction({ script: $script.val() });
|
await this.saveAction({ script: $script.val() });
|
||||||
}, 1000)
|
}, 1000);
|
||||||
|
|
||||||
$script.on('input', () => spacedUpdate.scheduleUpdate());
|
$script.on('input', () => spacedUpdate.scheduleUpdate());
|
||||||
|
|
||||||
|
@ -431,7 +431,7 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
|
|||||||
notes = JSON.parse(jsonStr);
|
notes = JSON.parse(jsonStr);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
logError(`Cannot parse ${jsonStr} into notes for drop`);
|
logError(`Cannot parse JSON '${jsonStr}' into notes for drop`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,10 +91,7 @@ function addNoteAttribute(req) {
|
|||||||
const noteId = req.params.noteId;
|
const noteId = req.params.noteId;
|
||||||
const body = req.body;
|
const body = req.body;
|
||||||
|
|
||||||
const attr = new Attribute(body);
|
new Attribute({...body, noteId}).save();
|
||||||
attr.noteId = noteId;
|
|
||||||
|
|
||||||
attr.save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteNoteAttribute(req) {
|
function deleteNoteAttribute(req) {
|
||||||
|
@ -4,8 +4,6 @@ const becca = require("../becca/becca");
|
|||||||
const cloningService = require("./cloning");
|
const cloningService = require("./cloning");
|
||||||
const branchService = require("./branches");
|
const branchService = require("./branches");
|
||||||
const utils = require("./utils");
|
const utils = require("./utils");
|
||||||
const dayjs = require("dayjs");
|
|
||||||
const cls = require("./cls.js");
|
|
||||||
|
|
||||||
const ACTION_HANDLERS = {
|
const ACTION_HANDLERS = {
|
||||||
addLabel: (action, note) => {
|
addLabel: (action, note) => {
|
||||||
@ -77,6 +75,8 @@ const ACTION_HANDLERS = {
|
|||||||
const targetParentNote = becca.getNote(action.targetParentNoteId);
|
const targetParentNote = becca.getNote(action.targetParentNoteId);
|
||||||
|
|
||||||
if (!targetParentNote) {
|
if (!targetParentNote) {
|
||||||
|
log.info(`Cannot execute moveNote because note ${action.targetParentNoteId} doesn't exist.`);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user