diff --git a/framework/saleor/utils/handle-account-activation.ts b/framework/saleor/utils/handle-account-activation.ts deleted file mode 100644 index d11f80ba1..000000000 --- a/framework/saleor/utils/handle-account-activation.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { FetcherOptions } from '@commerce/utils/types' -import throwUserErrors from './throw-user-errors' - -import { - MutationCustomerActivateArgs, - MutationCustomerActivateByUrlArgs, -} from '../schema' -import { Mutation } from '../schema' -import { customerActivateByUrlMutation } from './mutations' - -const handleAccountActivation = async ( - fetch: (options: FetcherOptions) => Promise, - input: MutationCustomerActivateByUrlArgs -) => { - try { - const { customerActivateByUrl } = await fetch< - Mutation, - MutationCustomerActivateArgs - >({ - query: customerActivateByUrlMutation, - variables: { - input, - }, - }) - - throwUserErrors(customerActivateByUrl?.customerUserErrors) - } catch (error) {} -} - -export default handleAccountActivation diff --git a/framework/saleor/utils/index.ts b/framework/saleor/utils/index.ts index 61e5975d7..3f80df3d2 100644 --- a/framework/saleor/utils/index.ts +++ b/framework/saleor/utils/index.ts @@ -7,7 +7,6 @@ export { default as getCheckoutId } from './get-checkout-id' export { default as checkoutCreate } from './checkout-create' export { default as checkoutToCart } from './checkout-to-cart' export { default as handleLogin, handleAutomaticLogin } from './handle-login' -export { default as handleAccountActivation } from './handle-account-activation' export { default as throwUserErrors } from './throw-user-errors' export * from './queries' export * from './mutations' diff --git a/framework/saleor/utils/mutations/checkout-create.ts b/framework/saleor/utils/mutations/checkout-create.ts index 9b5d37d42..cf971d654 100644 --- a/framework/saleor/utils/mutations/checkout-create.ts +++ b/framework/saleor/utils/mutations/checkout-create.ts @@ -4,7 +4,7 @@ const checkoutCreateMutation = /* GraphQL */ ` mutation createCheckout { checkoutCreate(input: { email: "customer@example.com", - lines: [{quantity: 1, variantId: "UHJvZHVjdFZhcmlhbnQ6Mjk3"}], + lines: [], channel: "default-channel" }) { errors { diff --git a/framework/saleor/utils/mutations/customer-activate-by-url.ts b/framework/saleor/utils/mutations/customer-activate-by-url.ts deleted file mode 100644 index 345d502bd..000000000 --- a/framework/saleor/utils/mutations/customer-activate-by-url.ts +++ /dev/null @@ -1,19 +0,0 @@ -const customerActivateByUrlMutation = /* GraphQL */ ` - mutation customerActivateByUrl($activationUrl: URL!, $password: String!) { - customerActivateByUrl(activationUrl: $activationUrl, password: $password) { - customer { - id - } - customerAccessToken { - accessToken - expiresAt - } - customerUserErrors { - code - field - message - } - } - } -` -export default customerActivateByUrlMutation diff --git a/framework/saleor/utils/mutations/customer-activate.ts b/framework/saleor/utils/mutations/customer-activate.ts deleted file mode 100644 index b1d057c69..000000000 --- a/framework/saleor/utils/mutations/customer-activate.ts +++ /dev/null @@ -1,19 +0,0 @@ -const customerActivateMutation = /* GraphQL */ ` - mutation customerActivate($id: ID!, $input: CustomerActivateInput!) { - customerActivate(id: $id, input: $input) { - customer { - id - } - customerAccessToken { - accessToken - expiresAt - } - customerUserErrors { - code - field - message - } - } - } -` -export default customerActivateMutation diff --git a/framework/saleor/utils/mutations/customer-create.ts b/framework/saleor/utils/mutations/customer-create.ts index 440141a81..f0a47be8f 100644 --- a/framework/saleor/utils/mutations/customer-create.ts +++ b/framework/saleor/utils/mutations/customer-create.ts @@ -1,13 +1,14 @@ const customerCreateMutation = /* GraphQL */ ` - mutation customerCreate($input: UserCreateInput!) { - customerCreate(input: $input) { + mutation customerCreate($input: AccountRegisterInput!) { + accountRegister(input: $input) { errors { code field message } - customer { - id + user { + email + isActive } } } diff --git a/framework/saleor/utils/mutations/index.ts b/framework/saleor/utils/mutations/index.ts index 165fb192d..db97566fd 100644 --- a/framework/saleor/utils/mutations/index.ts +++ b/framework/saleor/utils/mutations/index.ts @@ -5,5 +5,4 @@ export { default as checkoutLineItemUpdateMutation } from './checkout-line-item- 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' -export { default as customerActivateMutation } from './customer-activate' export { default as customerActivateByUrlMutation } from './customer-activate-by-url'