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