Add teams to a user when they are created

This commit is contained in:
Alex Holliday committed 2024-08-26 13:29:11 -07:00
1 parent a6f5c96f93
commit c39eab49bd
8 files changed
+26 -8

No files matched your search

+5 -4
View File
@@ -444,24 +444,26 @@ const Register = ({ isSuperAdmin }) => {
password: "",
confirm: "",
role: [],
teamId: "",
});
const [errors, setErrors] = useState({});
const [step, setStep] = useState(0);
useEffect(() => {
const fetchInvite = async () => {
console.log("FETCHING");
if (token !== undefined) {
try {
const res = await networkService.verifyInvitationToken(token);
const { role, email } = res.data.data;
setForm({ ...form, email, role });
const { role, email, teamId } = res.data.data;
setForm({ ...form, email, role, teamId });
} catch (error) {
logger.error(error);
}
}
};
fetchInvite();
}, [token, form]);
}, []);
/**
* Validates the form data against the validation schema.
@@ -494,7 +496,6 @@ const Register = ({ isSuperAdmin }) => {
const handleStepOne = async (e) => {
e.preventDefault();
let error = validateForm({
firstName: form.firstName,
lastName: form.lastName,