forked from crowetic/commerce
.vscode
assets
components
config
framework
bigcommerce
commerce
local
ordercloud
api
endpoints
cart
catalog
checkout
customer
address
card
add-item.ts
get-cards.ts
index.ts
remove-item.ts
update-item.ts
index.ts
login
logout
signup
wishlist
operations
utils
index.ts
auth
cart
checkout
customer
product
types
utils
wishlist
.env.template
README.md
commerce.config.json
constants.ts
fetcher.ts
index.tsx
next.config.js
provider.ts
saleor
shopify
swell
vendure
lib
pages
public
.editorconfig
.env.template
.eslintrc
.gitignore
.prettierignore
.prettierrc
README.md
codegen.bigcommerce.json
codegen.json
commerce.config.json
global.d.ts
license.md
next-env.d.ts
next.config.js
package.json
postcss.config.js
swell-js.d.ts
tailwind.config.js
tsconfig.json
yarn.lock
* Add ordercloud provider * Fix provider errors * Make submit checkout optional * Make submit checkout optional * Remove nullables when creating endpoint type * Update readme * Log checkout error * Log error * Save token to cookie * Update fetch rest * Use token at checkout Co-authored-by: Luis Alvarez <luis@vercel.com>
28 lines
797 B
TypeScript
28 lines
797 B
TypeScript
import type { CustomerCardSchema } from '../../../../types/customer/card'
|
|
import type { OrdercloudAPI } from '../../..'
|
|
|
|
import { GetAPISchema, createEndpoint } from '@commerce/api'
|
|
import customerCardEndpoint from '@commerce/api/endpoints/customer/card'
|
|
|
|
import getCards from './get-cards'
|
|
import addItem from './add-item'
|
|
import updateItem from './update-item'
|
|
import removeItem from './remove-item'
|
|
|
|
export type CustomerCardAPI = GetAPISchema<OrdercloudAPI, CustomerCardSchema>
|
|
export type CustomerCardEndpoint = CustomerCardAPI['endpoint']
|
|
|
|
export const handlers: CustomerCardEndpoint['handlers'] = {
|
|
getCards,
|
|
addItem,
|
|
updateItem,
|
|
removeItem,
|
|
}
|
|
|
|
const customerCardApi = createEndpoint<CustomerCardAPI>({
|
|
handler: customerCardEndpoint,
|
|
handlers,
|
|
})
|
|
|
|
export default customerCardApi
|