Merge branch 'dev'

# Conflicts:
#	app/_layout.tsx
#	firebase/functions/index.js
This commit is contained in:
Milan Paunovic
2025-02-15 16:44:45 +01:00
13 changed files with 2548 additions and 690 deletions

View File

@ -2,9 +2,11 @@ import { useAuthContext } from "@/contexts/AuthContext";
import { useMutation } from "@tanstack/react-query";
import functions from '@react-native-firebase/functions';
import { Alert } from 'react-native';
import { useSignOut } from './useSignOut';
export const useDeleteFamily = () => {
const { user } = useAuthContext();
const signOut = useSignOut();
return useMutation({
mutationKey: ["deleteFamily"],
@ -16,6 +18,11 @@ export const useDeleteFamily = () => {
try {
const deleteFamilyFunction = functions().httpsCallable('deleteFamily');
const result = await deleteFamilyFunction({ familyId });
if (result.data.success) {
await signOut.mutateAsync();
}
return result.data;
} catch (error: any) {
if (error.code === 'permission-denied') {