mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 07:26:59 +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(
|
||||
{ collection, make }: { collection: string; make?: string | string[] },
|
||||
{ collection }: { collection: string },
|
||||
filterId: string
|
||||
): 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>({
|
||||
query: getProductFiltersQuery,
|
||||
tags: [TAGS.collections, TAGS.products],
|
||||
variables: {
|
||||
handle: collection,
|
||||
...(_make
|
||||
? {
|
||||
filters: _make.map((make) => ({
|
||||
productMetafield: { namespace, key: metafieldKey, value: make }
|
||||
}))
|
||||
}
|
||||
: {})
|
||||
handle: collection
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user