diff --git a/lib/medusa/index.ts b/lib/medusa/index.ts index dfca4d1a2..8f511006e 100644 --- a/lib/medusa/index.ts +++ b/lib/medusa/index.ts @@ -316,7 +316,10 @@ export async function getCollections(): Promise { (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 { diff --git a/lib/medusa/types.ts b/lib/medusa/types.ts index 0ac747db1..315c970db 100644 --- a/lib/medusa/types.ts +++ b/lib/medusa/types.ts @@ -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