mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 01:31:12 -05:00
Fix: Approve database migration
This commit is contained in:
@@ -4,6 +4,7 @@ import { supabase } from '@/integrations/supabase/client';
|
||||
import { useToast } from '@/hooks/use-toast';
|
||||
import { AlertTriangle, Loader2 } from 'lucide-react';
|
||||
import { useState } from 'react';
|
||||
import { getErrorMessage } from '@/lib/errorHandler';
|
||||
|
||||
interface DeletionStatusBannerProps {
|
||||
scheduledDate: string;
|
||||
@@ -37,11 +38,12 @@ export function DeletionStatusBanner({ scheduledDate, onCancelled }: DeletionSta
|
||||
});
|
||||
|
||||
onCancelled();
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
const errorMsg = getErrorMessage(error);
|
||||
toast({
|
||||
variant: 'destructive',
|
||||
title: 'Error',
|
||||
description: error.message || 'Failed to cancel deletion',
|
||||
description: errorMsg,
|
||||
});
|
||||
} finally {
|
||||
setLoading(false);
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
} from '@/components/ui/form';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { handleError, handleSuccess, AppError } from '@/lib/errorHandler';
|
||||
import { handleError, handleSuccess, AppError, getErrorMessage } from '@/lib/errorHandler';
|
||||
import { logger } from '@/lib/logger';
|
||||
import { supabase } from '@/integrations/supabase/client';
|
||||
import { Loader2, Mail, CheckCircle2, AlertCircle } from 'lucide-react';
|
||||
@@ -185,13 +185,12 @@ export function EmailChangeDialog({ open, onOpenChange, currentEmail, userId }:
|
||||
);
|
||||
|
||||
setStep('success');
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
const errorMsg = getErrorMessage(error);
|
||||
logger.error('Email change failed', {
|
||||
userId,
|
||||
action: 'email_change',
|
||||
error: error instanceof Error ? error.message : String(error),
|
||||
errorCode: error.code,
|
||||
errorStatus: error.status
|
||||
error: errorMsg,
|
||||
});
|
||||
|
||||
if (error.message?.includes('rate limit') || error.status === 429) {
|
||||
|
||||
Reference in New Issue
Block a user