Login, Sign Up, Log Out, and checkout & customer association

This commit is contained in:
cond0r
2021-02-05 10:31:04 +02:00
parent 612392aaba
commit dde09c5105
21 changed files with 276 additions and 43 deletions

View File

@@ -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) => ({

View File

@@ -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}`,
},

View File

@@ -61,7 +61,6 @@ export function extendHook(
const response = useCommerceSearch(
{
query: getAllProductsQuery,
method: 'POST',
},
[
['search', input.search],