mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 00:35:50 +01:00
basic interactivity of search definition actions
This commit is contained in:
@@ -86,6 +86,16 @@ function setNoteAttribute(req) {
|
||||
attr.save();
|
||||
}
|
||||
|
||||
function addNoteAttribute(req) {
|
||||
const noteId = req.params.noteId;
|
||||
const body = req.body;
|
||||
|
||||
const attr = new Attribute(body);
|
||||
attr.noteId = noteId;
|
||||
|
||||
attr.save();
|
||||
}
|
||||
|
||||
function deleteNoteAttribute(req) {
|
||||
const noteId = req.params.noteId;
|
||||
const attributeId = req.params.attributeId;
|
||||
@@ -220,6 +230,7 @@ module.exports = {
|
||||
updateNoteAttributes,
|
||||
updateNoteAttribute,
|
||||
setNoteAttribute,
|
||||
addNoteAttribute,
|
||||
deleteNoteAttribute,
|
||||
getAttributeNames,
|
||||
getValuesForAttribute,
|
||||
|
||||
@@ -176,6 +176,7 @@ function register(app) {
|
||||
apiRoute(POST, '/api/notes/:noteId/saveToTmpDir', filesRoute.saveToTmpDir);
|
||||
|
||||
apiRoute(GET, '/api/notes/:noteId/attributes', attributesRoute.getEffectiveNoteAttributes);
|
||||
apiRoute(POST, '/api/notes/:noteId/attributes', attributesRoute.addNoteAttribute);
|
||||
apiRoute(PUT, '/api/notes/:noteId/attributes', attributesRoute.updateNoteAttributes);
|
||||
apiRoute(PUT, '/api/notes/:noteId/attribute', attributesRoute.updateNoteAttribute);
|
||||
apiRoute(PUT, '/api/notes/:noteId/set-attribute', attributesRoute.setNoteAttribute);
|
||||
|
||||
Reference in New Issue
Block a user