From 665bd7a18a68c31834f978ff610cea5003ada1e3 Mon Sep 17 00:00:00 2001 From: leca Date: Mon, 27 Jan 2025 17:11:10 +0300 Subject: [PATCH] bugfix --- backend/src/middlewares/utils.ts | 8 ++++---- frontend/src/pages/PostActions.tsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/src/middlewares/utils.ts b/backend/src/middlewares/utils.ts index 7dd0e86..ebee3df 100644 --- a/backend/src/middlewares/utils.ts +++ b/backend/src/middlewares/utils.ts @@ -40,10 +40,10 @@ const handlePostData = async (req: Request, res: Response, next: NextFunction): post.message = newFilename; post.type = 1; } else { - if (!post.message) { - res.status(400).send("Post message is not specified"); - return; - } + // if (!post.message) { + // res.status(400).send("Post message is not specified"); + // return; + // } post.type = 0; post.message = message; } diff --git a/frontend/src/pages/PostActions.tsx b/frontend/src/pages/PostActions.tsx index 5bc1bde..6cb3e4e 100644 --- a/frontend/src/pages/PostActions.tsx +++ b/frontend/src/pages/PostActions.tsx @@ -43,6 +43,7 @@ function PostActions() { if (!isMedia) { headers = { "Content-Type": "application/json" } } + await fetch(`/api/v1/post/${isUpdating ? `update/${toUpdate}` : "create"}`, { method: isUpdating ? "PUT" : "POST", headers, @@ -78,7 +79,6 @@ function PostActions() { ) : ( - )}