mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Don't fail when collections are not found (#996)
* Don't fail when collections are not found * fix another error
This commit is contained in:
@@ -265,6 +265,11 @@ export async function getCollectionProducts(handle: string): Promise<Product[]>
|
||||
}
|
||||
});
|
||||
|
||||
if (!res.body.data.collection) {
|
||||
console.log('No collection found for handle', handle);
|
||||
return [];
|
||||
}
|
||||
|
||||
return reshapeProducts(removeEdgesAndNodes(res.body.data.collection.products));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user