edit order

This commit is contained in:
hamid zarghami
2026-02-26 09:04:13 +03:30
parent d5a6342158
commit 54b86b718c
9 changed files with 195 additions and 113 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ const ProductList: FC = () => {
const { data: products, refetch } = useGetProducts()
const { mutate: deleteProduct, isPending: isDeleting } = useDeleteProduct()
const handleDelete = (id: number) => {
const handleDelete = (id: string) => {
deleteProduct(id, {
onSuccess: () => {
refetch()
+1 -1
View File
@@ -88,7 +88,7 @@ export const useUpdateProduct = () => {
export const useDeleteProduct = () => {
return useMutation({
mutationFn: (id: number) => api.deleteProduct(id),
mutationFn: (id: string) => api.deleteProduct(id),
});
};
+1 -1
View File
@@ -46,7 +46,7 @@ export const updateProduct = async (id: string, params:CreateProductType) => {
return data;
};
export const deleteProduct = async (id: number) => {
export const deleteProduct = async (id: string) => {
const { data } = await axios.delete(`/admin/products/${id}`);
return data;
};