mirror of
https://github.com/urosran/cally.git
synced 2025-07-14 09:17:19 +00:00
Update logic for profile creation
This commit is contained in:
12
hooks/firebase/useCreateSubUser.ts
Normal file
12
hooks/firebase/useCreateSubUser.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import {useMutation} from "react-query";
|
||||
import {UserProfile} from "@/hooks/firebase/types/profileTypes";
|
||||
import functions from '@react-native-firebase/functions';
|
||||
|
||||
export const useCreateSubUser = () => {
|
||||
return useMutation({
|
||||
mutationKey: ["createSubUser"],
|
||||
mutationFn: async ({email, password, ...userProfile}: { email: string, password: string } & UserProfile) => {
|
||||
return await functions().httpsCallable("createSubUser")({email, password, ...userProfile})
|
||||
}
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user