saleor: fix the type for collection

This commit is contained in:
Zaiste 2021-05-12 12:07:52 +02:00
parent 2fe2c71fc3
commit f4b66f2132
No known key found for this signature in database
GPG Key ID: 15DF7EBC7F2FFE35

View File

@ -1,6 +1,6 @@
import { SaleorConfig } from '../api'
import { CollectionEdge } from '../schema'
import getSiteCollectionsQuery from './queries/get-all-collections-query'
import { Collection, CollectionCountableEdge } from '../schema'
import { getSiteCollectionsQuery } from './queries/'
export type Category = {
entityId: string
@ -17,7 +17,7 @@ const getCategories = async (config: SaleorConfig): Promise<Category[]> => {
return (
data.collections?.edges?.map(
({ node: { id: entityId, name, slug } }: CollectionEdge) => ({
({ node: { id: entityId, name, slug } }: CollectionCountableEdge) => ({
entityId,
name,
path: `/${slug}`,