Update logic for profile creation

This commit is contained in:
Milan Paunovic
2024-08-21 20:03:40 +02:00
parent 4a20f7a53e
commit 957e0a582e
16 changed files with 1670 additions and 2228 deletions

View 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})
}
});
}