Commit Graph
2 Commits
Author SHA1 Message Date
juliaandClaude Sonnet 4.6 841f53fac8 Fix code review findings: image read, whitespace validation, offset reset, cleanup error
- Replace src.Read(data) with io.ReadAll(src) to prevent silent truncation on large uploads
- Reject zero-byte file uploads with 400 rather than storing empty BYTEA
- Add strings.TrimSpace to validateFruit so whitespace-only name/osdb_number returns 422
- Reset offset to 0 in fruitStore.create() so navigating back to list after create shows page 1
- Log t.Cleanup DELETE error in integration test to surface constraint failures clearly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 10:28:51 +02:00
juliaandClaude Sonnet 4.6 1b889ac112 feat: manage fruits — full CRUD with images and synonyms (story #02)
Backend: domain structs, FruitRepository interface + pg implementation,
9 Echo v4 handlers (list/get/create/update/delete, image sub-resources),
migration 000002 (fruit_type ENUM, fruits, fruit_synonyms, fruit_images),
route-scoped BodyLimit("5M") for uploads, http.DetectContentType for serving.

Frontend: typed fetch API layer, Pinia setup-style fruitStore, FruitList
(paginated), FruitCreate, and FruitDetail (edit + synonyms editor + image
gallery). 25 backend unit tests + integration test; 18 frontend tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 10:18:01 +02:00