2021-03-04 14:51:55 +00:00
|
|
|
export const isCollectionVisible = (resp, collectionId) => {
|
|
|
|
const collection = resp.body.data.collection;
|
|
|
|
return collection !== null && collection.id === collectionId;
|
|
|
|
};
|
2021-02-24 13:21:19 +00:00
|
|
|
|
2021-03-04 14:51:55 +00:00
|
|
|
export const isProductInCollectionVisible = (resp, productId) => {
|
|
|
|
const productsList = resp.body.data.collection.products;
|
|
|
|
return (
|
|
|
|
productsList.totalCount !== 0 && productsList.edges[0].node.id === productId
|
|
|
|
);
|
|
|
|
};
|