Hi,
I have a hydrogen website where I modified the cart.tsx action function to include a call to a 3rd party API when an item is added to the cart. This works perfectly on localhost but when I deployed my codebase to Oxygen, this API seems to not get called. I do not see any network logs on Chrome Dev Tools too. Does anyone know what is happening? My simple fetch code below. Thanks
export async function action({request, context}: ActionArgs) {
const {session, storefront} = context;
const headers = new Headers();
...
switch (cartAction) {
case CartAction.ADD_TO_CART:
...
let jsonData: any;
//make request to 3rd party API
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
cache: 'no-cache',
});
jsonData = await response.json();
//do something with this data
}
...
return json(
{
cart,
errors,
analytics: {
cartId,
},
},
{status, headers},
);
}