Fix: Include cloudflare_image_id in photo deletions

This commit is contained in:
gpt-engineer-app[bot]
2025-10-17 23:23:48 +00:00
parent 1317722c74
commit 559b4e1e55

View File

@@ -28,6 +28,7 @@ import { Card, CardContent } from '@/components/ui/card';
interface Photo { interface Photo {
id: string; id: string;
cloudflare_image_id: string;
cloudflare_image_url: string; cloudflare_image_url: string;
title: string | null; title: string | null;
caption: string | null; caption: string | null;
@@ -69,7 +70,7 @@ export function PhotoManagementDialog({
try { try {
const { data, error } = await supabase const { data, error } = await supabase
.from('photos') .from('photos')
.select('id, cloudflare_image_url, title, caption, order_index, is_featured') .select('id, cloudflare_image_id, cloudflare_image_url, title, caption, order_index, is_featured')
.eq('entity_type', entityType) .eq('entity_type', entityType)
.eq('entity_id', entityId) .eq('entity_id', entityId)
.order('order_index', { ascending: true }); .order('order_index', { ascending: true });
@@ -149,6 +150,7 @@ export function PhotoManagementDialog({
item_type: 'photo_delete', item_type: 'photo_delete',
item_data: { item_data: {
photo_id: photoToDelete.id, photo_id: photoToDelete.id,
cloudflare_image_id: photoToDelete.cloudflare_image_id,
entity_type: entityType, entity_type: entityType,
entity_id: entityId, entity_id: entityId,
entity_name: entityName, entity_name: entityName,