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() { ) : ( - )}