fix: Type error in TastingList for optional bottle_id

This commit is contained in:
2025-12-19 20:50:42 +01:00
parent e8c3032954
commit 0a692498ce

View File

@@ -16,7 +16,7 @@ interface Tasting {
palate_notes?: string;
finish_notes?: string;
is_sample?: boolean;
bottle_id: string;
bottle_id?: string;
created_at: string;
tasting_buddies?: {
buddies: {
@@ -180,7 +180,7 @@ export default function TastingList({ initialTastings, currentUserId, bottleId }
</div>
{(!currentUserId || note.user_id === currentUserId) && !note.isPending && (
<button
onClick={() => handleDelete(note.id, note.bottle_id)}
onClick={() => note.id && note.bottle_id && handleDelete(note.id, note.bottle_id)}
disabled={!!isDeleting}
className="px-3 py-1.5 text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20 rounded-xl transition-all disabled:opacity-50 flex items-center gap-2 border border-red-100 dark:border-red-900/30 font-black text-[10px] uppercase tracking-widest shadow-sm hover:bg-red-600 hover:text-white dark:hover:bg-red-600 dark:hover:text-white"
title="Tasting löschen"