mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-01 04:12:58 +08:00
chore(lint): get rid of "any" in attachments
req.file is of type "Express.Multer.File | undefined". Returning with an "uploaded: false" type object -> same handling as in image.ts
This commit is contained in:
parent
dfb8982a99
commit
c8e36942fc
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user