Skip to content

Commit

Permalink
✨ Admin profile validation (#1047)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ayushpatel1248 authored Jun 20, 2024
1 parent a9ddf03 commit 77297ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/pages/Admin/Components/Profile/Profile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down Expand Up @@ -225,6 +225,7 @@ export function Profile(props) {
<div className={style["name"]}>{name}</div>
<div className={style["line"]}></div>
<div className={style["contact"]}>
<div className={style["contact-details"]}>{username}</div>
<div className={style["contact-details"]}>{email}</div>
<div className={style["contact-details"]}>{phone}</div>
</div>
Expand Down

0 comments on commit 77297ce

Please sign in to comment.