additional hooks

This commit is contained in:
ivic00
2024-08-22 22:02:43 +02:00
parent 55a3091023
commit 0a862e7a8c
14 changed files with 3376 additions and 2999 deletions

View File

@ -9,9 +9,9 @@ export const useCreateSubUser = () => {
return useMutation({
mutationKey: ["createSubUser"],
mutationFn: async ({email, password, ...userProfile}: { email: string, password: string } & UserProfile) => {
if(profileType === ProfileType.parent) {
return await functions().httpsCallable("createSubUser")({email, password, ...userProfile})
mutationFn: async ({email, ...userProfile}: { email: string } & UserProfile) => {
if(profileType === ProfileType.PARENT) {
return await functions().httpsCallable("createSubUser")({email, ...userProfile})
} else {
throw Error("Can't create sub-users as a non-parent.")
}