fix(umkm): fix TypeError, 404 API URL, and Recharts warnings
This commit is contained in:
24
MIND/PLAN/fix-umkm-bugs.md
Normal file
24
MIND/PLAN/fix-umkm-bugs.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Plan: Fix 3 Bugs in UMKM Module
|
||||
|
||||
## 1. TypeError: Cannot set properties of undefined (setting 'loading')
|
||||
- **File**: `src/app/darmasaba/(pages)/ekonomi/pasar-desa/page.tsx`
|
||||
- **Root Cause**: `load` method is destructured from Valtio proxy, causing `this` binding to be lost.
|
||||
- **Fix**: Remove `load` from destructuring and call it directly via `umkmState.produk.findMany.load` or `umkmState.umkm.findMany.load`.
|
||||
|
||||
## 2. 404 Not Found - Category Product API
|
||||
- **File**: `src/app/admin/(dashboard)/_state/ekonomi/umkm/umkm.ts`
|
||||
- **Root Cause**: Incorrect API URL for fetching category products.
|
||||
- **Fix**: Update URL from `/api/ekonomi/pasar-desa/kategori-produk/find-many-all` to `/api/ekonomi/kategoriproduk/find-many-all`.
|
||||
|
||||
## 3. Recharts Warning: width(-1) height(-1)
|
||||
- **Location**: UMKM Admin Dashboard.
|
||||
- **Root Cause**: Missing explicit height on chart container.
|
||||
- **Fix**: Add `style={{ height: 300 }}` to the container and wrap charts with `ResponsiveContainer`.
|
||||
|
||||
## Steps:
|
||||
1. Fix `src/app/darmasaba/(pages)/ekonomi/pasar-desa/page.tsx`.
|
||||
2. Fix `src/app/admin/(dashboard)/_state/ekonomi/umkm/umkm.ts`.
|
||||
3. Locate and fix chart containers in UMKM admin dashboard.
|
||||
4. Verify changes locally.
|
||||
5. Run build to ensure no compile errors.
|
||||
6. Commit and deploy.
|
||||
6
MIND/PLAN/task-fix-umkm-bugs.md
Normal file
6
MIND/PLAN/task-fix-umkm-bugs.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Task: Fix UMKM Module Bugs
|
||||
|
||||
- [x] Fix TypeError in `src/app/darmasaba/(pages)/ekonomi/pasar-desa/page.tsx` <!-- id: 0 -->
|
||||
- [x] Fix 404 API URL in `src/app/admin/(dashboard)/_state/ekonomi/umkm/umkm.ts` <!-- id: 1 -->
|
||||
- [x] Fix Recharts warning in UMKM admin dashboard <!-- id: 2 -->
|
||||
- [x] Run build and verify <!-- id: 3 -->
|
||||
Reference in New Issue
Block a user