1.9 KiB
1.9 KiB
F-075 — Implementer evidence: Inline edit SKU/EAN/STOCK in inventory module; remove Actions column
Problem
The inventory page had:
- SKU and EAN displayed as plain text (no edit capability)
- Stock editable via a small ✏️ button, but not by clicking the value itself
- Vestigial "Acción" column header (th) with no corresponding data cell (td) in tbody
Changes
API client
project/apps/admin/src/lib/api-client.ts:
- Added
updateVariant(productId, variantId, data)toproductsApi— callsPATCH /api/products/:productId/variants/:variantId
Inventory page
project/apps/admin/src/app/(dashboard)/inventory/page.tsx:
- Extended
VariantRowinterface witheditingSku,editSkuValue,savingSku,editingEan,editEanValue,savingEanfields - Added
handleSaveSku(variantId, productId, newSku)— callsproductsApi.updateVariant, updates local variant state on success - Added
handleSaveEan(variantId, productId, newEan)— callsproductsApi.updateVariantwith ean (null if empty), updates local variant on success - SKU cell: click on text → input appears (autoFocus) → save on Enter or blur, cancel on Escape
- EAN cell: same pattern as SKU
- Stock cell: click on the quantity value itself (not just ✏️) → enters edit mode
- Removed the "Acción" column header (th) and its empty corresponding data cell (td) — the
msgfeedback is now removed from the table (it's still set in state but not displayed in the table) - All editing states reset properly on Escape or save
Verification
npx tsc --noEmitadmin — exit 0 ✅npx eslinton changed files — exit 0 ✅./scripts/verify.sh— exit 0 ✅
Files touched
project/apps/admin/src/lib/api-client.ts (modified)
project/apps/admin/src/app/(dashboard)/inventory/page.tsx (modified)
work/artifacts/F-075/implementer.md (this file)