From 59c9723b87f0f86cf1747f7abd0d777539969196 Mon Sep 17 00:00:00 2001 From: Sammeta Mahesh Babu <70381126+sammetamaheshbabu@users.noreply.github.com> Date: Mon, 24 Jun 2024 20:02:10 +0530 Subject: [PATCH] Update CreatePost.jsx - Even the error also trying to navigating the post page --- client/src/pages/CreatePost.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/pages/CreatePost.jsx b/client/src/pages/CreatePost.jsx index f7929d2..efb2968 100644 --- a/client/src/pages/CreatePost.jsx +++ b/client/src/pages/CreatePost.jsx @@ -69,7 +69,7 @@ export default function CreatePost() { body: JSON.stringify(formData), }); const data = await res.json(); - if (!res.ok) { + if (data.success === false) { setPublishError(data.message); return; }