fix(server): align attachment upload validation with note upload

This commit is contained in:
Elian Doran
2026-04-04 20:46:03 +03:00
parent 8ac9daa5d3
commit 8ff41d8fa9

View File

@@ -232,6 +232,10 @@ function uploadModifiedFileToAttachment(req: Request) {
const { attachmentId } = req.params;
const { filePath } = req.body;
if (!createdTemporaryFiles.has(filePath)) {
throw new ValidationError(`File '${filePath}' is not a temporary file.`);
}
const attachment = becca.getAttachmentOrThrow(attachmentId);
log.info(`Updating attachment '${attachmentId}' with content from '${filePath}'`);