Deduplicate admin review product images

This commit is contained in:
2026-06-01 14:00:14 +07:00
parent 4e28ccdbd1
commit 84c81d4a2b
2 changed files with 53 additions and 28 deletions

View File

@ -26,7 +26,31 @@ Latest TypeScript verification after the validation/upload changes:
npx tsc --noEmit
```
## Latest Codex Changes After `2cfff02`
## Latest Codex Changes After `4e28ccd`
### Admin review image dedupe
File:
- `src/app/admin/review/[productId]/page.tsx`
Behavior:
- Admin product review now deduplicates product images before rendering.
- The dedupe applies to both:
- update compare section (`Gambar Produk`)
- normal admin review gallery (`Galeri`)
- Root `imageId` / `image` and entries inside `productImages` are merged and sorted by `sequence`.
- Duplicate images are removed by `imageId`, with URL as a fallback key.
- This prevents the main image from appearing twice when backend sends it both as root `imageId` and inside `productImages`.
Verification:
```bash
npm run build
```
The local production server was restarted on `http://localhost:3000` for manual admin review testing.
## Previous Codex Changes After `2cfff02`
### Product edit image payload preservation