diff --git a/app/(public)/products/[id]/page.tsx b/app/(public)/products/[id]/page.tsx index 3d2ac23..696e0f2 100644 --- a/app/(public)/products/[id]/page.tsx +++ b/app/(public)/products/[id]/page.tsx @@ -1,7 +1,6 @@ import { createClient } from "@/lib/supabase-server" import { getSiteContents } from "@/lib/data" import { notFound } from "next/navigation" -import Image from "next/image" import Link from "next/link" import { Button } from "@/components/ui/button" import { Badge } from "@/components/ui/badge" diff --git a/components/dashboard/product-form.tsx b/components/dashboard/product-form.tsx index d89004b..6f2a70d 100644 --- a/components/dashboard/product-form.tsx +++ b/components/dashboard/product-form.tsx @@ -31,7 +31,7 @@ import imageCompression from 'browser-image-compression' import { createClient } from "@/lib/supabase-browser" import Image from "next/image" -import { createProduct, updateProduct, deleteProductImage } from "@/app/(dashboard)/dashboard/products/actions" +import { createProduct, updateProduct } from "@/app/(dashboard)/dashboard/products/actions" const productSchema = z.object({ name: z.string().min(2, "Ürün adı en az 2 karakter olmalıdır"), @@ -167,14 +167,8 @@ export function ProductForm({ initialData }: ProductFormProps) { const imageToDelete = previewImages[index] // If editing an existing product and image is from server (starts with http/https usually) - if (initialData && imageToDelete.startsWith("http")) { - const result = await deleteProductImage(imageToDelete, initialData.id) - if (!result.success) { - toast.error("Resim silinirken hata oluştu") - return - } - toast.success("Resim silindi") - } + // Local state removal only. Server update happens on Save. + // if (initialData && imageToDelete.startsWith("http")) { ... } const currentImages = [...form.getValues("images") || []] // Filter out the deleted image URL if it matches diff --git a/components/dashboard/sms-page-client.tsx b/components/dashboard/sms-page-client.tsx index 48c65a6..0bdeb6b 100644 --- a/components/dashboard/sms-page-client.tsx +++ b/components/dashboard/sms-page-client.tsx @@ -30,7 +30,7 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select" -import { Loader2, Send, Users, Save, Trash2, BookOpen, Smartphone } from "lucide-react" +import { Loader2, Send, Save, Trash2, BookOpen, Smartphone } from "lucide-react" import { toast } from "sonner" import { ScrollArea } from "@/components/ui/scroll-area"