mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 14:06:59 +00:00
fix: hide hidden colections
This commit is contained in:
parent
f4a71fa67d
commit
3c091ce5f6
@ -316,7 +316,10 @@ export async function getCollections(): Promise<ProductCollection[]> {
|
||||
(collection: MedusaProductCollection) => reshapeCollection(collection)
|
||||
);
|
||||
|
||||
return collections;
|
||||
// Hide collections starting with 'hidden'
|
||||
const filtered = collections.filter((collection) => !collection.handle.startsWith('hidden'));
|
||||
|
||||
return filtered;
|
||||
}
|
||||
|
||||
export async function getProduct(handle: string): Promise<Product> {
|
||||
|
@ -1,7 +1,7 @@
|
||||
export type MedusaProductCollection = {
|
||||
id: string;
|
||||
title: string;
|
||||
handle: string | null;
|
||||
handle: string;
|
||||
products?: Product[];
|
||||
created_at: string; // format: date-time
|
||||
updated_at: string; // format: date-time
|
||||
|
Loading…
x
Reference in New Issue
Block a user