From 4489b11d15b4534b4c260b3c39473432826883fc Mon Sep 17 00:00:00 2001 From: Alexander Holliday Date: Mon, 29 Jul 2024 07:16:52 -0700 Subject: [PATCH] removed tq file (#474) --- tq | 62 -------------------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 tq diff --git a/tq b/tq deleted file mode 100644 index e5dcc3bab..000000000 --- a/tq +++ /dev/null @@ -1,62 +0,0 @@ -diff --git a/Client/src/Pages/Auth/Register/Register.jsx b/Client/src/Pages/Auth/Register/Register.jsx -index 1eaa99f..a5db763 100644 ---- a/Client/src/Pages/Auth/Register/Register.jsx -+++ b/Client/src/Pages/Auth/Register/Register.jsx -@@ -14,10 +14,12 @@ import { credentials } from "../../../Validation/validation"; - import { createToast } from "../../../Utils/toastUtils"; - import Field from "../../../Components/Inputs/Field"; - import { register } from "../../../Features/Auth/authSlice"; -+import { useParams } from "react-router-dom"; -  - const Register = ({ isAdmin }) => { - const dispatch = useDispatch(); - const navigate = useNavigate(); -+ const { token } = useParams(); - const theme = useTheme(); -  - // TODO If possible, change the IDs of these fields to match the backend -@@ -35,14 +37,14 @@ const Register = ({ isAdmin }) => { - email: "", - password: "", - confirm: "", -- role: "", -+ role: [], - }); - const [errors, setErrors] = useState({}); -  - const handleSubmit = async (e) => { - e.preventDefault(); -  -- const registerForm = { ...form, role: isAdmin ? "admin" : "user" }; -+ const registerForm = { ...form, role: isAdmin ? ["admin"] : [] }; - const { error } = credentials.validate(registerForm, { - abortEarly: false, - context: { password: form.password }, -diff --git a/Client/src/Validation/validation.js b/Client/src/Validation/validation.js -index 779b7c5..00d5a1d 100644 ---- a/Client/src/Validation/validation.js -+++ b/Client/src/Validation/validation.js -@@ -68,9 +68,7 @@ const credentials = joi.object({ - } - return value; - }), -- role: joi.string().messages({ -- "string.empty": "Role is required", -- }), -+ role: joi.array().required(), - }); -  - const monitorValidation = joi.object({ -diff --git a/Server/validation/joi.js b/Server/validation/joi.js -index a0c5857..ec77363 100644 ---- a/Server/validation/joi.js -+++ b/Server/validation/joi.js -@@ -44,7 +44,7 @@ const registerValidation = joi.object({ - /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*()])[A-Za-z0-9!@#$%^&*()]+$/ - ), - profileImage: joi.any(), -- role: joi.string().required(), -+ role: joi.array().required(), - }); -  - const editUserParamValidation = joi.object({