forked from crowetic/commerce
updated useSignup hook
This commit is contained in:
parent
f0a2c744e8
commit
377015ceac
@ -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
|
||||||
|
3
pages/api/bigcommerce/customers/signup.ts
Normal file
3
pages/api/bigcommerce/customers/signup.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import signupApi from '@lib/bigcommerce/api/customers/signup'
|
||||||
|
|
||||||
|
export default signupApi()
|
Loading…
x
Reference in New Issue
Block a user