4
0
forked from crowetic/commerce

updated useSignup hook

This commit is contained in:
Luis Alvarez 2020-10-21 09:17:52 -05:00
parent f0a2c744e8
commit 377015ceac
2 changed files with 7 additions and 4 deletions

View File

@ -1,16 +1,16 @@
import { useCallback } from 'react' import { useCallback } from 'react'
import { HookFetcher } from '@lib/commerce/utils/types' import { HookFetcher } from '@lib/commerce/utils/types'
import useCommerceSignup from '@lib/commerce/use-signup' import useCommerceSignup from '@lib/commerce/use-signup'
import type { CreateCustomerBody } from './api/customers' import type { SignupBody } from './api/customers/signup'
const defaultOpts = { const defaultOpts = {
url: '/api/bigcommerce/customers', url: '/api/bigcommerce/customers/signup',
method: 'POST', method: 'POST',
} }
export type SignupInput = CreateCustomerBody export type SignupInput = SignupBody
export const fetcher: HookFetcher<null, CreateCustomerBody> = ( export const fetcher: HookFetcher<null, SignupBody> = (
options, options,
{ firstName, lastName, email, password }, { firstName, lastName, email, password },
fetch fetch

View File

@ -0,0 +1,3 @@
import signupApi from '@lib/bigcommerce/api/customers/signup'
export default signupApi()