fix update product

- from change row. `products_id` to `id`
This commit is contained in:
Wikzyy
2025-04-08 11:51:39 +07:00
parent 65584183d5
commit 508b8ee1d6

View File

@ -126,13 +126,13 @@ const ManageProductsContextProvider = ({ children }: { children: React.ReactNode
<>
<button
className="btn btn-sm btn-icon btn-clear btn-light"
onClick={() => handleEditDialog(true, row.products_id)}
onClick={() => handleEditDialog(true, row.id)}
>
<KeenIcon icon="notepad-edit" />
</button>
<button
className="btn btn-sm btn-icon btn-clear btn-light"
onClick={() => handleDeleteDialog(true, row.products_id)}
onClick={() => handleDeleteDialog(true, row.id)}
>
<KeenIcon icon="trash" />
</button>
@ -160,7 +160,7 @@ const ManageProductsContextProvider = ({ children }: { children: React.ReactNode
order_direction: sorting[0].desc == false ? 'ASC' : 'DESC',
filter: JSON.stringify(filter)
});
console.log(response?.data);
// console.log(response?.data);
setProducts(response?.data.list);
return { data: response?.data.list, totalCount: response?.data.total_count };
} catch (error) {