Skip to content

Build your personal knowledge base with Trilium Notes

chore(lint): get rid of "any" in attachments

Panagiotis Papadopoulosc8e36942fc8e
diff --git a/src/routes/api/attachments.ts b/src/routes/api/attachments.ts
index b0b46db1f8..718c999149 100644
--- a/src/routes/api/attachments.ts
+++ b/src/routes/api/attachments.ts
@@ -43,7 +43,14 @@ function saveAttachment(req: Request) {
function uploadAttachment(req: Request) {
const { noteId } = req.params;
- const { file } = req as any;
+ const { file } = req;
+
+ if (!file) {
+ return {
+ uploaded: false,
+ message: `Missing attachment data.`
+ };
+ }
const note = becca.getNoteOrThrow(noteId);
let url;