const updateShopSavedViews = useCallback(
async (updatedViews) => {
if (!data?.id) return;
try {
await api.shopifyShop.update(data.id, {
savedViews: updatedViews
});
shopify.toast.show('View saved', {
duration: 2000
});
} catch (error) {
shopify.toast.show('Failed to save view', {
duration: 2000,
isError: true
});
}
},
[data?.id]
);
const updateShopSavedViews = useCallback(
async (updatedViews) => {
if (!data?.id) return;
try {
await api.shopifyShop.update(data.id, {
savedViews: updatedViews
});
shopify.toast.show('View saved', {
duration: 2000
});
} catch (error) {
shopify.toast.show('Failed to save view', {
duration: 2000,
isError: true
});
}
},
[data?.id]
);