mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	attachments WIP
This commit is contained in:
		| @@ -19,6 +19,14 @@ function getAttachment(req) { | ||||
|     return becca.getAttachmentOrThrow(attachmentId, {includeContentLength: true}); | ||||
| } | ||||
|  | ||||
| function getAllAttachments(req) { | ||||
|     const {attachmentId} = req.params; | ||||
|     // one particular attachment is requested, but return all note's attachments | ||||
|  | ||||
|     const attachment = becca.getAttachmentOrThrow(attachmentId); | ||||
|     return attachment.getNote()?.getAttachments({includeContentLength: true}) || []; | ||||
| } | ||||
|  | ||||
| function saveAttachment(req) { | ||||
|     const {noteId} = req.params; | ||||
|     const {attachmentId, role, mime, title, content} = req.body; | ||||
| @@ -48,6 +56,7 @@ module.exports = { | ||||
|     getAttachmentBlob, | ||||
|     getAttachments, | ||||
|     getAttachment, | ||||
|     getAllAttachments, | ||||
|     saveAttachment, | ||||
|     deleteAttachment, | ||||
|     convertAttachmentToNote | ||||
|   | ||||
		Reference in New Issue
	
	Block a user