Hello,
I want to use the code snippet below to prevent a request from being sent to the backend service by intercepting the ‘delete-car’ event. The intention is to only delete the card from the frontend UI without making a request to the backend when the api.intercept
returns false. However, even when api.intercept
returns false, the card is not removed from the UI.
api.intercept('delete-car', (obj) => {
if (obj === 12) {
return false;
}
return true;
});
Could you please advise on how to correctly implement this requirement? Is it appropriate to use api.intercept
for this purpose?