Commented out admin check, unsure as to whether or not more than one admin can exist

This commit is contained in:
Alex Holliday committed 2024-07-23 14:30:27 -07:00
1 parent c77414f2d7
commit 608153b461
6 files changed
+23 -23

No files matched your search

@@ -185,7 +185,7 @@ const TeamPanel = () => {
"/auth/invite",
{
email: toInvite.email,
role: [toInvite.role],
role: toInvite.role,
},
{ headers: { Authorization: `Bearer ${authToken}` } }
);
+2 -2
View File
@@ -49,6 +49,7 @@ const Register = ({ isAdmin }) => {
token,
});
const { role, email } = res.data.data;
console.log(role);
setForm({ ...form, email, role });
} catch (error) {
console.log(error);
@@ -60,8 +61,7 @@ const Register = ({ isAdmin }) => {
const handleSubmit = async (e) => {
e.preventDefault();
const registerForm = { ...form, role: isAdmin ? ["admin"] : [] };
const registerForm = { ...form, role: isAdmin ? ["admin"] : form.role };
const { error } = credentials.validate(registerForm, {
abortEarly: false,
context: { password: form.password },