mirror of
https://github.com/urosran/cally.git
synced 2025-07-15 09:45:20 +00:00
additional hooks
This commit is contained in:
@ -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.")
|
||||
}
|
||||
|
Reference in New Issue
Block a user