mirror of
https://github.com/urosran/cally.git
synced 2025-07-17 10:35:08 +00:00
Fix
This commit is contained in:
@ -9,8 +9,8 @@ export const useSignUp = () => {
|
||||
return useMutation({
|
||||
mutationKey: ["signUp"],
|
||||
mutationFn: async ({email, password}: { email: string, password: string }) => {
|
||||
await auth().createUserWithEmailAndPassword(email, password);
|
||||
await updateUserData({userType: ProfileType.PARENT, email, password});
|
||||
const res= await auth().createUserWithEmailAndPassword(email, password);
|
||||
await updateUserData({userType: ProfileType.PARENT, email, password, customUser: res.user});
|
||||
}
|
||||
});
|
||||
}
|
@ -2,13 +2,16 @@ import {useAuthContext} from "@/contexts/AuthContext";
|
||||
import {useMutation} from "react-query";
|
||||
import firestore from "@react-native-firebase/firestore";
|
||||
import {UserProfile} from "@/hooks/firebase/types/profileTypes";
|
||||
import {FirebaseAuthTypes} from "@react-native-firebase/auth";
|
||||
|
||||
export const useUpdateUserData = () => {
|
||||
const {user, setProfileData} = useAuthContext()
|
||||
const {user: currentUser, setProfileData} = useAuthContext()
|
||||
|
||||
return useMutation({
|
||||
mutationKey: ["updateUserData"],
|
||||
mutationFn: async (newProfileData: Partial<UserProfile>) => {
|
||||
mutationFn: async (newProfileData: Partial<UserProfile & { customUser?: FirebaseAuthTypes.User }>) => {
|
||||
const user = currentUser ?? newProfileData.customUser
|
||||
|
||||
if (user) {
|
||||
try {
|
||||
console.log("yall don't even");
|
||||
|
Reference in New Issue
Block a user