mirror of
https://github.com/urosran/cally.git
synced 2025-07-17 02:25:10 +00:00
user settings, points slider
This commit is contained in:
@ -7,7 +7,8 @@ export interface User {
|
||||
|
||||
export interface UserProfile {
|
||||
userType: ProfileType;
|
||||
name: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
childrenIds?: string[];
|
||||
birthday?: Date;
|
||||
parentId?: string;
|
||||
|
@ -8,9 +8,9 @@ export const useSignUp = () => {
|
||||
|
||||
return useMutation({
|
||||
mutationKey: ["signUp"],
|
||||
mutationFn: async ({email, password}: { email: string, password: string }) => {
|
||||
mutationFn: async ({email, password, firstName, lastName}: { email: string, password: string, firstName: string, lastName: string }) => {
|
||||
const res = await auth().createUserWithEmailAndPassword(email, password);
|
||||
await updateUserData({newUserData: {userType: ProfileType.PARENT}, customUser: res.user});
|
||||
await updateUserData({newUserData: {userType: ProfileType.PARENT, firstName: firstName, lastName: lastName}, customUser: res.user});
|
||||
}
|
||||
});
|
||||
}
|
@ -17,7 +17,7 @@ export const useUpdateUserData = () => {
|
||||
await firestore()
|
||||
.collection("Profiles")
|
||||
.doc(user.uid)
|
||||
.set(newUserData);
|
||||
.update(newUserData);
|
||||
|
||||
const profileData = await firestore().collection("Profiles").doc(user?.uid!).get()
|
||||
setProfileData(profileData.data() as UserProfile)
|
||||
|
Reference in New Issue
Block a user