mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 04:51:13 -05:00
Fix blog post foreign key
This commit is contained in:
@@ -15,6 +15,7 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { UppyPhotoUpload } from '@/components/upload/UppyPhotoUpload';
|
||||
import { generateSlugFromName } from '@/lib/slugUtils';
|
||||
import { extractCloudflareImageId } from '@/lib/cloudflareImageUtils';
|
||||
import { Edit, Trash2, Eye, Plus } from 'lucide-react';
|
||||
import { toast } from 'sonner';
|
||||
import { formatDistanceToNow } from 'date-fns';
|
||||
@@ -284,11 +285,14 @@ export default function AdminBlog() {
|
||||
<div className="space-y-2">
|
||||
<Label>Featured Image</Label>
|
||||
<UppyPhotoUpload
|
||||
onUploadComplete={(results) => {
|
||||
if (results.length > 0) {
|
||||
const result = results[0];
|
||||
handleImageUpload(result.cloudflareImageId, result.cloudflareImageUrl);
|
||||
toast.success('Image uploaded');
|
||||
onUploadComplete={(urls) => {
|
||||
if (urls.length > 0) {
|
||||
const url = urls[0];
|
||||
const imageId = extractCloudflareImageId(url);
|
||||
if (imageId) {
|
||||
handleImageUpload(imageId, url);
|
||||
toast.success('Image uploaded');
|
||||
}
|
||||
}
|
||||
}}
|
||||
maxFiles={1}
|
||||
|
||||
Reference in New Issue
Block a user