mirror of
https://github.com/vercel/commerce.git
synced 2025-07-26 19:51:23 +00:00
Removed @framework imports within framework providers
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { CollectionEdge } from '@framework/schema'
|
||||
import { CollectionEdge } from '../schema'
|
||||
import { getConfig, ShopifyConfig } from '../api'
|
||||
import getAllCollectionsQuery from '../utils/queries/get-all-collections-query'
|
||||
|
||||
|
@@ -2,7 +2,7 @@ import { GraphQLFetcherResult } from '@commerce/api'
|
||||
import { getConfig, ShopifyConfig } from '../api'
|
||||
import { ProductEdge } from '../schema'
|
||||
import { getAllProductsQuery } from '../utils/queries'
|
||||
import { normalizeProduct } from '@framework/utils/normalize'
|
||||
import { normalizeProduct } from '../utils/normalize'
|
||||
import { Product } from '@commerce/types'
|
||||
|
||||
type Variables = {
|
||||
|
@@ -1,17 +1,16 @@
|
||||
import { SWRHook } from '@commerce/utils/types'
|
||||
import useSearch, { UseSearch } from '@commerce/product/use-search'
|
||||
|
||||
import { ProductEdge } from '@framework/schema'
|
||||
import { ProductEdge } from '../schema'
|
||||
import {
|
||||
getAllProductsQuery,
|
||||
getSearchVariables,
|
||||
normalizeProduct,
|
||||
} from '@framework/utils'
|
||||
import type { ShopifyProvider } from '..'
|
||||
} from '../utils'
|
||||
|
||||
import { Product } from '@commerce/types'
|
||||
|
||||
export default useSearch as UseSearch<ShopifyProvider>
|
||||
export default useSearch as UseSearch<typeof handler>
|
||||
|
||||
export type SearchProductsInput = {
|
||||
search?: string
|
||||
@@ -40,7 +39,10 @@ export const handler: SWRHook<
|
||||
})
|
||||
const edges = resp.products?.edges
|
||||
return {
|
||||
products: edges?.map(({ node: p }: ProductEdge) => normalizeProduct(p)),
|
||||
products: edges?.map(({ node: p }: ProductEdge) =>
|
||||
// TODO: Fix this product type
|
||||
normalizeProduct(p as any)
|
||||
),
|
||||
found: !!edges?.length,
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user