LOgging in with qr code added

This commit is contained in:
Milan Paunovic
2024-09-29 23:03:21 +02:00
parent 92f335543f
commit 5922179584
15 changed files with 820 additions and 993 deletions
+3 -1
View File
@@ -12,8 +12,9 @@ export const useCreateSubUser = () => {
mutationFn: async ({email, ...userProfile}: { email: string } & UserProfile) => {
if (profileType === ProfileType.PARENT) {
return await functions().httpsCallable("createSubUser")({
...userProfile,
email,
userProfile: {...userProfile, familyId: profileData?.familyId}
familyId: profileData?.familyId
})
} else {
throw Error("Can't create sub-users as a non-parent.")
@@ -21,6 +22,7 @@ export const useCreateSubUser = () => {
},
onSuccess: () => {
queryClient.invalidateQueries({queryKey: ["getChildrenByParentId"]})
queryClient.invalidateQueries({queryKey: ["familyMembers"]})
}
});
}