I am a beginner in Vue.js and I am working on calling an API. It is functioning perfectly, but I need to update the Vue.js array based on a condition of the API response. However, when trying to do so, I encounter the error "do not mutate vuex store state outside mutation handlers." How can I resolve this issue?
axios.post(baseUrl+'/api/v1/addProductWishlist', pitem,
{headers: {
'Authorization': 'Bearer ' + x,
'Content-Type':'application/json'
}
}).then(r => {
if(r.data.status == 202)
{
}
else{
state.cartItems.push(payload);
}
});