server-ts: Convert etapi/notes

This commit is contained in:
Elian Doran
2024-04-07 16:56:45 +03:00
parent e4024408bd
commit 5fdf094e9d
8 changed files with 95 additions and 55 deletions

View File

@@ -88,6 +88,13 @@ function updateImage(req: AppRequest) {
const note = becca.getNoteOrThrow(noteId);
if (!file) {
return {
uploaded: false,
message: `Missing image data.`
};
}
if (!["image/png", "image/jpeg", "image/gif", "image/webp", "image/svg+xml"].includes(file.mimetype)) {
return {
uploaded: false,