fix(tax): All 4 issues resolved

## Fixes:

1.  Suggested rates now inside Tax Rates card as help notice
   - Shows as blue notice box
   - Only shows rates not yet added
   - Auto-hides when all suggested rates added

2.  Add Rate button now works
   - Fixed mutation to properly invalidate queries
   - Shows success toast
   - Updates list immediately

3.  Add Tax Rate dialog no longer blank
   - Replaced shadcn Select with native select
   - Form now submits properly
   - All fields visible

4.  Tax toggle now functioning
   - Changed onChange to onCheckedChange
   - Added required id prop
   - Properly typed checked parameter

## Additional:
- Added api.put() method to api.ts
- Improved UX with suggested rates as contextual help
This commit is contained in:
dwindown
2025-11-10 13:31:47 +07:00
parent 28bbce5434
commit 0012d827bb
2 changed files with 51 additions and 53 deletions

View File

@@ -59,6 +59,14 @@ export const api = {
});
},
async put(path: string, body?: any) {
return api.wpFetch(path, {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: body != null ? JSON.stringify(body) : undefined,
});
},
async del(path: string) {
return api.wpFetch(path, { method: 'DELETE' });
},