add clear cart functionality
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user