From 572e3336a7e5ec87b243072cdf18ff426ba1db6d Mon Sep 17 00:00:00 2001 From: Enes Furkan Arslan Date: Mon, 25 Dec 2023 20:39:54 +0300 Subject: [PATCH] fixed the error on signup and moderation pages Moderation posts on moderation-not-jury page were not getting updated when a tag change happens. I fixed the error by changing the function call place. Also while siging up password validation was working incorrectly. It is also fixed by updating the regex. --- prediction-polls/frontend/src/Pages/Auth/SignUp/index.jsx | 2 +- prediction-polls/frontend/src/Pages/Moderation/index.jsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/prediction-polls/frontend/src/Pages/Auth/SignUp/index.jsx b/prediction-polls/frontend/src/Pages/Auth/SignUp/index.jsx index ee775ccb..bc5fef8b 100644 --- a/prediction-polls/frontend/src/Pages/Auth/SignUp/index.jsx +++ b/prediction-polls/frontend/src/Pages/Auth/SignUp/index.jsx @@ -152,7 +152,7 @@ function SignUp() { message: "Password must be at least 8 characters!", }, { - pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[A-Za-z\d]{8,}$/, + pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$/, message: "Password must include uppercase, lowercase, and a number!", }, diff --git a/prediction-polls/frontend/src/Pages/Moderation/index.jsx b/prediction-polls/frontend/src/Pages/Moderation/index.jsx index 8559fe67..55c7fb13 100644 --- a/prediction-polls/frontend/src/Pages/Moderation/index.jsx +++ b/prediction-polls/frontend/src/Pages/Moderation/index.jsx @@ -97,13 +97,14 @@ function Moderation() { } // Handle success + handlePostUpdate(); + } catch (error) { console.error('Error updating tags:', error.message); } }; postUpdatedTags(); - handlePostUpdate();