From 77297ce6083cb8b7daffb55d643f6695365cce65 Mon Sep 17 00:00:00 2001 From: ayushpatel1248 <127100604+ayushpatel1248@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:06:47 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Admin=20profile=20validation=20(#10?= =?UTF-8?q?47)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(QandA):input getting cleared and auto closing the pop after the submission input should not get cleared if validaion is not matched and also question pop up should be closed if question is uploaded successfully fix issue #977 * fix(admin profile): admin profile username validation fixed in admin profile username was not letting enter username which contain numbers or underscore and was giving the validation error now it is fixed now it take both underscore and number also fixes #1042 * Update Profile.jsx * Update Profile.jsx : now username is displayed in profile --- frontend/src/pages/Admin/Components/Profile/Profile.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/Admin/Components/Profile/Profile.jsx b/frontend/src/pages/Admin/Components/Profile/Profile.jsx index abfafad4..e03e5fd5 100644 --- a/frontend/src/pages/Admin/Components/Profile/Profile.jsx +++ b/frontend/src/pages/Admin/Components/Profile/Profile.jsx @@ -37,7 +37,7 @@ export function Profile(props) { lastName: Joi.string().regex(/^[A-Za-z]*$/).required().label("Last Name"), email: Joi.string().email().required().label("Email"), phone: Joi.string().regex(/[+]91[6-9]{1}[0-9]{9}$/).required().label("Contact Number"), - username: Joi.string().regex(/^[A-Za-z]+$/).required().label("Username") + username: Joi.string().regex(/^[A-Za-z][A-Za-z0-9_]{7,29}$/).required().label("Username") }; const handleCloseToast = () => { @@ -225,6 +225,7 @@ export function Profile(props) {
{name}
+
{username}
{email}
{phone}