mirror of
https://github.com/vercel/commerce.git
synced 2025-07-26 19:51:23 +00:00
Login, Sign Up, Log Out, and checkout & customer association
This commit is contained in:
@@ -11,7 +11,7 @@ const getAllCollections = async (options?: {
|
||||
config = getConfig(config)
|
||||
|
||||
const { data } = await config.fetch(getAllCollectionsQuery, { variables })
|
||||
const edges = data.collections?.edges ?? []
|
||||
const edges = data?.collections?.edges ?? []
|
||||
|
||||
const categories = edges.map(
|
||||
({ node: { id: entityId, title: name, handle } }: CollectionEdge) => ({
|
||||
|
@@ -18,12 +18,12 @@ const getAllProductPaths = async (options?: {
|
||||
variables,
|
||||
})
|
||||
|
||||
const edges = data.products?.edges
|
||||
const productInfo = data.products?.productInfo
|
||||
const edges = data?.products?.edges
|
||||
const productInfo = data?.products?.productInfo
|
||||
const hasNextPage = productInfo?.hasNextPage
|
||||
|
||||
return {
|
||||
products: edges.map(({ node: { handle } }: ProductEdge) => ({
|
||||
products: edges?.map(({ node: { handle } }: ProductEdge) => ({
|
||||
node: {
|
||||
path: `/${handle}`,
|
||||
},
|
||||
|
@@ -61,7 +61,6 @@ export function extendHook(
|
||||
const response = useCommerceSearch(
|
||||
{
|
||||
query: getAllProductsQuery,
|
||||
method: 'POST',
|
||||
},
|
||||
[
|
||||
['search', input.search],
|
||||
|
Reference in New Issue
Block a user