mirror of
https://github.com/vercel/commerce.git
synced 2025-05-16 06:26:58 +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)
|
(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> {
|
export async function getProduct(handle: string): Promise<Product> {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
export type MedusaProductCollection = {
|
export type MedusaProductCollection = {
|
||||||
id: string;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
handle: string | null;
|
handle: string;
|
||||||
products?: Product[];
|
products?: Product[];
|
||||||
created_at: string; // format: date-time
|
created_at: string; // format: date-time
|
||||||
updated_at: string; // format: date-time
|
updated_at: string; // format: date-time
|
||||||
|
Loading…
x
Reference in New Issue
Block a user