mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 15:36:58 +00:00
revert accidental merging
This commit is contained in:
parent
e0fb5e4a11
commit
a9ad351786
@ -1200,24 +1200,14 @@ export const getFile = async (id: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export async function getProductFilters(
|
export async function getProductFilters(
|
||||||
{ collection, make }: { collection: string; make?: string | string[] },
|
{ collection }: { collection: string },
|
||||||
filterId: string
|
filterId: string
|
||||||
): Promise<Filter | null | undefined> {
|
): Promise<Filter | null | undefined> {
|
||||||
const [namespace, metafieldKey] = MAKE_FILTER_ID.split('.').slice(-2);
|
|
||||||
const _make = Array.isArray(make) ? make : make ? [make] : undefined;
|
|
||||||
|
|
||||||
const res = await shopifyFetch<ShopifyCollectionProductsOperation>({
|
const res = await shopifyFetch<ShopifyCollectionProductsOperation>({
|
||||||
query: getProductFiltersQuery,
|
query: getProductFiltersQuery,
|
||||||
tags: [TAGS.collections, TAGS.products],
|
tags: [TAGS.collections, TAGS.products],
|
||||||
variables: {
|
variables: {
|
||||||
handle: collection,
|
handle: collection
|
||||||
...(_make
|
|
||||||
? {
|
|
||||||
filters: _make.map((make) => ({
|
|
||||||
productMetafield: { namespace, key: metafieldKey, value: make }
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
: {})
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user