fix: photos lost on save, multi-upload only kept last file, thumbnails 400
recipe-form/API routes were never sending/persisting photos on create+update. PhotoUploader accumulated uploads via a stale closure over the photos prop, so only the last file of a multi-select survived. Once both were fixed, thumbnails still 400'd because Next's image optimizer blocks upstream hosts resolving to private/loopback IPs (localhost:9000 MinIO) — skip optimization for storage-hosted photos since they're already web-sized user uploads.
This commit is contained in:
@@ -147,6 +147,7 @@ export function CookedItReview({
|
||||
<div className="relative h-16 w-16">
|
||||
<Image
|
||||
src={preview ?? getPublicUrl(photoKey!)}
|
||||
unoptimized
|
||||
alt="Your cooked-it photo"
|
||||
fill
|
||||
className="rounded-lg object-cover border"
|
||||
@@ -209,6 +210,7 @@ export function CookedItReview({
|
||||
<div className="relative h-32 w-32">
|
||||
<Image
|
||||
src={getPublicUrl(r.photoKey)}
|
||||
unoptimized
|
||||
alt={`${r.user.name}'s cooked-it photo`}
|
||||
fill
|
||||
className="rounded-lg object-cover border"
|
||||
|
||||
Reference in New Issue
Block a user