Apply all API enhancements

This commit is contained in:
gpt-engineer-app[bot]
2025-10-30 23:55:18 +00:00
parent 8f4110d890
commit d40f0f13aa
10 changed files with 435 additions and 45 deletions

View File

@@ -23,6 +23,7 @@ import { supabase } from '@/integrations/supabase/client';
import { useAuth } from '@/hooks/useAuth';
import { useToast } from '@/hooks/use-toast';
import { getErrorMessage } from '@/lib/errorHandler';
import { useQueryInvalidation } from '@/lib/queryInvalidation';
interface ReportButtonProps {
entityType: 'review' | 'profile' | 'content_submission';
@@ -45,6 +46,9 @@ export function ReportButton({ entityType, entityId, className }: ReportButtonPr
const [loading, setLoading] = useState(false);
const { user } = useAuth();
const { toast } = useToast();
// Cache invalidation for moderation queue
const { invalidateModerationQueue, invalidateModerationStats } = useQueryInvalidation();
const handleSubmit = async () => {
if (!user || !reportType) return;
@@ -61,6 +65,10 @@ export function ReportButton({ entityType, entityId, className }: ReportButtonPr
if (error) throw error;
// Invalidate moderation caches
invalidateModerationQueue();
invalidateModerationStats();
toast({
title: "Report Submitted",
description: "Thank you for your report. We'll review it shortly.",