add clear cart functionality

This commit is contained in:
2025-09-18 22:23:03 +05:30
parent 20adf3439c
commit 0777de9290
2 changed files with 24 additions and 17 deletions

View File

@@ -27,7 +27,7 @@ export const ProductContextProvider = ({ children }) => {
fetchCategory();
}, []);
const cartFn = async (variantId, designId, quantity) => {
const cartFn = async (variantId, designId, quantity, showToast = true) => {
try{
const response = await authAxios.post('/orders/cart/manage_item/',{
@@ -35,7 +35,9 @@ export const ProductContextProvider = ({ children }) => {
design: designId,
quantity: quantity
})
toast.success('Modified Cart Successfully!')
if (showToast) {
toast.success('Modified Cart Successfully!')
}
return response
}
catch(error){