mirror of
https://github.com/vercel/commerce.git
synced 2025-05-19 07:56:59 +00:00
19 lines
620 B
TypeScript
19 lines
620 B
TypeScript
import { GetAPISchema, createEndpoint } from '@commerce/api'
|
|
import customerEndpoint from '@commerce/api/endpoints/customer'
|
|
import type { CustomerSchema } from '../../../types/customer'
|
|
import type { BigcommerceAPI } from '../..'
|
|
import getLoggedInCustomer from './get-logged-in-customer'
|
|
|
|
export type CustomerAPI = GetAPISchema<BigcommerceAPI, CustomerSchema>
|
|
|
|
export type CustomerEndpoint = CustomerAPI['endpoint']
|
|
|
|
export const handlers: CustomerEndpoint['handlers'] = { getLoggedInCustomer }
|
|
|
|
const customerApi = createEndpoint<CustomerAPI>({
|
|
handler: customerEndpoint,
|
|
handlers,
|
|
})
|
|
|
|
export default customerApi
|