fix: Product form TypeScript and API errors

Fixed Issues:
1. TypeScript error on .indeterminate property (line 332)
   - Cast checkbox element to any for indeterminate access
2. API error handling for categories/tags endpoints
   - Added is_wp_error() checks
   - Return empty array on error instead of 500

Next: Implement modern tabbed product form (Shopify-style)
This commit is contained in:
dwindown
2025-11-19 22:00:15 +07:00
parent 5126b2ca64
commit 89b31fc9c3
2 changed files with 13 additions and 1 deletions

View File

@@ -329,7 +329,11 @@ export default function Products() {
<th className="w-12 p-3">
<Checkbox
checked={allSelected}
ref={(el) => el && (el.indeterminate = someSelected && !allSelected)}
ref={(el) => {
if (el) {
(el as any).indeterminate = someSelected && !allSelected;
}
}}
onCheckedChange={toggleAll}
aria-label={__('Select all')}
/>