mirror of
https://github.com/vercel/commerce.git
synced 2025-06-20 06:01:21 +00:00
saleor: remove unused code
This commit is contained in:
parent
e98a9f4d6f
commit
3873b48c59
@ -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: <T = any, B = Body>(options: FetcherOptions<B>) => Promise<T>,
|
|
||||||
input: MutationCustomerActivateByUrlArgs
|
|
||||||
) => {
|
|
||||||
try {
|
|
||||||
const { customerActivateByUrl } = await fetch<
|
|
||||||
Mutation,
|
|
||||||
MutationCustomerActivateArgs
|
|
||||||
>({
|
|
||||||
query: customerActivateByUrlMutation,
|
|
||||||
variables: {
|
|
||||||
input,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
throwUserErrors(customerActivateByUrl?.customerUserErrors)
|
|
||||||
} catch (error) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default handleAccountActivation
|
|
@ -7,7 +7,6 @@ export { default as getCheckoutId } from './get-checkout-id'
|
|||||||
export { default as checkoutCreate } from './checkout-create'
|
export { default as checkoutCreate } from './checkout-create'
|
||||||
export { default as checkoutToCart } from './checkout-to-cart'
|
export { default as checkoutToCart } from './checkout-to-cart'
|
||||||
export { default as handleLogin, handleAutomaticLogin } from './handle-login'
|
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 { default as throwUserErrors } from './throw-user-errors'
|
||||||
export * from './queries'
|
export * from './queries'
|
||||||
export * from './mutations'
|
export * from './mutations'
|
||||||
|
@ -4,7 +4,7 @@ const checkoutCreateMutation = /* GraphQL */ `
|
|||||||
mutation createCheckout {
|
mutation createCheckout {
|
||||||
checkoutCreate(input: {
|
checkoutCreate(input: {
|
||||||
email: "customer@example.com",
|
email: "customer@example.com",
|
||||||
lines: [{quantity: 1, variantId: "UHJvZHVjdFZhcmlhbnQ6Mjk3"}],
|
lines: [],
|
||||||
channel: "default-channel"
|
channel: "default-channel"
|
||||||
}) {
|
}) {
|
||||||
errors {
|
errors {
|
||||||
|
@ -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
|
|
@ -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
|
|
@ -1,13 +1,14 @@
|
|||||||
const customerCreateMutation = /* GraphQL */ `
|
const customerCreateMutation = /* GraphQL */ `
|
||||||
mutation customerCreate($input: UserCreateInput!) {
|
mutation customerCreate($input: AccountRegisterInput!) {
|
||||||
customerCreate(input: $input) {
|
accountRegister(input: $input) {
|
||||||
errors {
|
errors {
|
||||||
code
|
code
|
||||||
field
|
field
|
||||||
message
|
message
|
||||||
}
|
}
|
||||||
customer {
|
user {
|
||||||
id
|
email
|
||||||
|
isActive
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,5 +5,4 @@ export { default as checkoutLineItemUpdateMutation } from './checkout-line-item-
|
|||||||
export { default as checkoutLineItemRemoveMutation } from './checkout-line-item-remove'
|
export { default as checkoutLineItemRemoveMutation } from './checkout-line-item-remove'
|
||||||
export { default as customerAccessTokenCreateMutation } from './customer-access-token-create'
|
export { default as customerAccessTokenCreateMutation } from './customer-access-token-create'
|
||||||
export { default as customerAccessTokenDeleteMutation } from './customer-access-token-delete'
|
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'
|
export { default as customerActivateByUrlMutation } from './customer-activate-by-url'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user