mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 02:11:14 -05:00
Fix: Address HMR failures and Fast Refresh incompatibility
This commit is contained in:
@@ -4,6 +4,7 @@ import { useToast } from '@/hooks/use-toast';
|
||||
import { logger } from '@/lib/logger';
|
||||
import { getErrorMessage } from '@/lib/errorHandler';
|
||||
import { validateMultipleItems } from '@/lib/entityValidationSchemas';
|
||||
import { invokeWithTracking } from '@/lib/edgeFunctionTracking';
|
||||
import type { User } from '@supabase/supabase-js';
|
||||
import type { ModerationItem } from '@/types/moderation';
|
||||
|
||||
@@ -182,16 +183,20 @@ export function useModerationActions(config: ModerationActionsConfig): Moderatio
|
||||
}
|
||||
}
|
||||
|
||||
await supabase.functions.invoke('process-selective-approval', {
|
||||
body: {
|
||||
const { data, error, requestId } = await invokeWithTracking(
|
||||
'process-selective-approval',
|
||||
{
|
||||
itemIds: submissionItems.map((i) => i.id),
|
||||
submissionId: item.id,
|
||||
},
|
||||
});
|
||||
config.user?.id
|
||||
);
|
||||
|
||||
if (error) throw error;
|
||||
|
||||
toast({
|
||||
title: 'Submission Approved',
|
||||
description: `Successfully processed ${submissionItems.length} item(s)`,
|
||||
description: `Successfully processed ${submissionItems.length} item(s)${requestId ? ` (Request: ${requestId.substring(0, 8)})` : ''}`,
|
||||
});
|
||||
return;
|
||||
} else if (action === 'rejected') {
|
||||
@@ -339,18 +344,20 @@ export function useModerationActions(config: ModerationActionsConfig): Moderatio
|
||||
return;
|
||||
}
|
||||
|
||||
const { error } = await supabase.functions.invoke('process-selective-approval', {
|
||||
body: {
|
||||
const { data, error, requestId } = await invokeWithTracking(
|
||||
'process-selective-approval',
|
||||
{
|
||||
itemIds: failedItems.map((i) => i.id),
|
||||
submissionId: item.id,
|
||||
},
|
||||
});
|
||||
config.user?.id
|
||||
);
|
||||
|
||||
if (error) throw error;
|
||||
|
||||
toast({
|
||||
title: 'Items Retried',
|
||||
description: `Successfully retried ${failedItems.length} failed item(s)`,
|
||||
description: `Successfully retried ${failedItems.length} failed item(s)${requestId ? ` (Request: ${requestId.substring(0, 8)})` : ''}`,
|
||||
});
|
||||
|
||||
logger.log(`✅ Retried ${failedItems.length} failed items for ${item.id}`);
|
||||
|
||||
Reference in New Issue
Block a user