|
|
@@ -2,7 +2,6 @@ import { useState } from 'react';
|
|
|
import { useQuery } from '@tanstack/react-query';
|
|
|
import { useForm } from 'react-hook-form';
|
|
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
|
-import { z } from 'zod';
|
|
|
import { Plus, Search, Edit, Trash2, Folder } from 'lucide-react';
|
|
|
import { toast } from 'sonner';
|
|
|
|
|
|
@@ -117,7 +116,7 @@ export const GoodsCategories = () => {
|
|
|
|
|
|
try {
|
|
|
const res = await goodsCategoryClient[':id']['$delete']({
|
|
|
- param: { id: categoryToDelete.toString() },
|
|
|
+ param: { id: categoryToDelete },
|
|
|
});
|
|
|
|
|
|
if (res.status === 204) {
|
|
|
@@ -150,7 +149,7 @@ export const GoodsCategories = () => {
|
|
|
|
|
|
try {
|
|
|
const res = await goodsCategoryClient[':id']['$put']({
|
|
|
- param: { id: editingCategory.id.toString() },
|
|
|
+ param: { id: editingCategory.id },
|
|
|
json: data,
|
|
|
});
|
|
|
if (res.status !== 200) throw new Error('更新失败');
|