mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 05:15:59 +01:00
grid view improvements, remembering grid/list status
This commit is contained in:
@@ -62,13 +62,27 @@ function updateNoteAttribute(req) {
|
||||
|
||||
attribute.save();
|
||||
|
||||
console.log("Saving", attribute);
|
||||
|
||||
return {
|
||||
attributeId: attribute.attributeId
|
||||
};
|
||||
}
|
||||
|
||||
function setNoteAttribute(req) {
|
||||
const noteId = req.params.noteId;
|
||||
const body = req.body;
|
||||
|
||||
let attr = repository.getEntity(`SELECT * FROM attributes WHERE isDeleted = 0 AND noteId = ? AND type = ? AND name = ?`, [noteId, body.type, body.name]);
|
||||
|
||||
if (attr) {
|
||||
attr.value = body.value;
|
||||
} else {
|
||||
attr = new Attribute(body);
|
||||
attr.noteId = noteId;
|
||||
}
|
||||
|
||||
attr.save();
|
||||
}
|
||||
|
||||
function deleteNoteAttribute(req) {
|
||||
const noteId = req.params.noteId;
|
||||
const attributeId = req.params.attributeId;
|
||||
@@ -200,6 +214,7 @@ function deleteRelation(req) {
|
||||
module.exports = {
|
||||
updateNoteAttributes,
|
||||
updateNoteAttribute,
|
||||
setNoteAttribute,
|
||||
deleteNoteAttribute,
|
||||
getAttributeNames,
|
||||
getValuesForAttribute,
|
||||
|
||||
Reference in New Issue
Block a user