Moved auth & cart hooks + several fixes

This commit is contained in:
cond0r
2021-02-22 14:06:34 +02:00
parent 005fe9d6c9
commit 528d7556a8
53 changed files with 447 additions and 331 deletions

View File

@@ -16,7 +16,7 @@ const getCategories = async (config: ShopifyConfig): Promise<Category[]> => {
})
return (
data?.collections?.edges?.map(
data.collections?.edges?.map(
({ node: { title: name, handle } }: CollectionEdge) => ({
entityId: handle,
name,

View File

@@ -17,7 +17,7 @@ const getErrorMessage = ({
}
const handleLogin = (data: any) => {
const response = data?.customerAccessTokenCreate
const response = data.customerAccessTokenCreate
const errors = response?.customerUserErrors
if (errors && errors.length) {

View File

@@ -4,7 +4,6 @@ export { default as getSortVariables } from './get-sort-variables'
export { default as getVendors } from './get-vendors'
export { default as getCategories } from './get-categories'
export { default as getCheckoutId } from './get-checkout-id'
export * from './queries'
export * from './mutations'
export * from './normalize'

View File

@@ -1,10 +1,7 @@
export { default as createCustomerMutation } from './customer-create'
export { default as checkoutCreateMutation } from './checkout-create'
export { default as checkoutLineItemAddMutation } from './checkout-line-item-add'
export { default as checkoutLineItemUpdateMutation } from './checkout-create'
export { default as checkoutLineItemRemoveMutation } from './checkout-line-item-remove'
export { default as customerCreateMutation } from './customer-create'
export { default as checkoutCreateMutation } from './checkout-create'
export { default as checkoutLineItemAddMutation } from './checkout-line-item-add'
export { default as checkoutLineItemUpdateMutation } from './checkout-line-item-update'
export { default as checkoutLineItemRemoveMutation } from './checkout-line-item-remove'
export { default as customerAccessTokenCreateMutation } from './customer-access-token-create'
export { default as customerAccessTokenDeleteMutation } from './customer-access-token-delete'

View File

@@ -1,4 +1,4 @@
export const checkoutDetailsFragment = /* GraphQL */ `
export const checkoutDetailsFragment = `
id
webUrl
subtotalPrice

View File

@@ -7,4 +7,4 @@ export { default as getCollectionProductsQuery } from './get-collection-products
export { default as getCheckoutQuery } from './get-checkout-query'
export { default as getAllPagesQuery } from './get-all-pages-query'
export { default as getPageQuery } from './get-page-query'
export { default as getCustomerQuery } from './get-checkout-query'
export { default as getCustomerQuery } from './get-customer-query'