mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
allow setting image labels in sender API
This commit is contained in:
parent
2ff6e50af4
commit
20465a4f71
@ -17,7 +17,17 @@ function uploadImage(req) {
|
|||||||
|
|
||||||
const parentNote = dateNoteService.getDateNote(req.headers['x-local-date']);
|
const parentNote = dateNoteService.getDateNote(req.headers['x-local-date']);
|
||||||
|
|
||||||
const {noteId} = imageService.saveImage(parentNote.noteId, file.buffer, originalName, true);
|
const {note, noteId} = imageService.saveImage(parentNote.noteId, file.buffer, originalName, true);
|
||||||
|
|
||||||
|
const labelsStr = req.headers['x-labels'];
|
||||||
|
|
||||||
|
if (labelsStr?.trim()) {
|
||||||
|
const labels = JSON.parse(labelsStr);
|
||||||
|
|
||||||
|
for (const {name, value} of labels) {
|
||||||
|
note.setLabel(attributeService.sanitizeAttributeName(name), value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
noteId: noteId
|
noteId: noteId
|
||||||
|
Loading…
x
Reference in New Issue
Block a user