refactor: adjust the types

This commit is contained in:
Zaiste
2021-04-19 15:36:35 +02:00
parent b5e21a54b3
commit 1e946c8b47
6 changed files with 15 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
import { SWRHook } from '@commerce/utils/types'
import useSearch, { UseSearch } from '@commerce/product/use-search'
import { ProductEdge } from '../schema'
import { ProductCountableEdge } from '../schema'
import {
getAllProductsQuery,
getCollectionProductsQuery,
@@ -57,7 +57,9 @@ export const handler: SWRHook<
}
return {
products: edges.map(({ node }: ProductEdge) => normalizeProduct(node)),
products: edges.map(({ node }: ProductCountableEdge) =>
normalizeProduct(node)
),
found: !!edges.length,
}
},