feat: Implement plan for bug fixes

This commit is contained in:
gpt-engineer-app[bot]
2025-10-21 13:27:23 +00:00
parent 827f0f8ea5
commit ce6c9d6866
14 changed files with 94 additions and 59 deletions

View File

@@ -1,4 +1,5 @@
import { useReducer } from 'react';
import { invokeWithTracking } from '@/lib/edgeFunctionTracking';
import { AlertDialog, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter } from '@/components/ui/alert-dialog';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
@@ -57,9 +58,11 @@ export function AccountDeletionDialog({ open, onOpenChange, userEmail, onDeletio
dispatch({ type: 'SET_LOADING', payload: true });
try {
const { data, error } = await supabase.functions.invoke('request-account-deletion', {
body: {},
});
const { data, error, requestId } = await invokeWithTracking(
'request-account-deletion',
{},
(await supabase.auth.getUser()).data.user?.id
);
if (error) throw error;
@@ -88,9 +91,11 @@ export function AccountDeletionDialog({ open, onOpenChange, userEmail, onDeletio
dispatch({ type: 'SET_LOADING', payload: true });
try {
const { error } = await supabase.functions.invoke('confirm-account-deletion', {
body: { confirmation_code: state.confirmationCode },
});
const { error, requestId } = await invokeWithTracking(
'confirm-account-deletion',
{ confirmation_code: state.confirmationCode },
(await supabase.auth.getUser()).data.user?.id
);
if (error) throw error;
@@ -110,9 +115,11 @@ export function AccountDeletionDialog({ open, onOpenChange, userEmail, onDeletio
dispatch({ type: 'SET_LOADING', payload: true });
try {
const { error } = await supabase.functions.invoke('resend-deletion-code', {
body: {},
});
const { error, requestId } = await invokeWithTracking(
'resend-deletion-code',
{},
(await supabase.auth.getUser()).data.user?.id
);
if (error) throw error;