disable unknown fields

This commit is contained in:
Zaiste 2021-04-19 15:39:14 +02:00
parent 5402af4902
commit de1f3259f0
No known key found for this signature in database
GPG Key ID: 15DF7EBC7F2FFE35

View File

@ -46,12 +46,13 @@ export const handler: SWRHook<
if (categoryId) {
edges = data.node?.products?.edges ?? []
if (brandId) {
edges = edges.filter(
({ node: { vendor } }: ProductEdge) =>
vendor.replace(/\s+/g, '-').toLowerCase() === brandId
)
}
// FIXME @zaiste, no `vendor` in Saleor
// if (brandId) {
// edges = edges.filter(
// ({ node: { vendor } }: ProductCountableEdge) =>
// vendor.replace(/\s+/g, '-').toLowerCase() === brandId
// )
// }
} else {
edges = data.products?.edges ?? []
}