mirror of
https://github.com/vercel/commerce.git
synced 2025-06-19 05:31:22 +00:00
Updated catalog products
This commit is contained in:
parent
2353f4b3ed
commit
11200b3bb1
@ -1,4 +1,5 @@
|
||||
import type { GetAPISchema } from '@commerce/api'
|
||||
import { GetAPISchema, createEndpoint } from '@commerce/api'
|
||||
import productsEndpoint from '@commerce/api/endpoints/catalog/products'
|
||||
import type { ProductsSchema } from '../../../../types/product'
|
||||
import type { BigcommerceAPI } from '../../..'
|
||||
import getProducts from './get-products'
|
||||
@ -7,4 +8,11 @@ export type ProductsAPI = GetAPISchema<BigcommerceAPI, ProductsSchema>
|
||||
|
||||
export type ProductsEndpoint = ProductsAPI['endpoint']
|
||||
|
||||
export const handlers = { getProducts }
|
||||
export const handlers: ProductsEndpoint['handlers'] = { getProducts }
|
||||
|
||||
const productsApi = createEndpoint<ProductsAPI>({
|
||||
handler: productsEndpoint,
|
||||
handlers,
|
||||
})
|
||||
|
||||
export default productsApi
|
||||
|
@ -1,11 +1,4 @@
|
||||
import products from '@commerce/api/endpoints/catalog/products'
|
||||
import {
|
||||
ProductsAPI,
|
||||
handlers,
|
||||
} from '@framework/api/endpoints/catalog/products'
|
||||
import productsApi from '@framework/api/endpoints/catalog/products'
|
||||
import commerce from '@lib/api/commerce'
|
||||
|
||||
export default commerce.endpoint({
|
||||
handler: products as ProductsAPI['endpoint']['handler'],
|
||||
handlers,
|
||||
})
|
||||
export default productsApi(commerce)
|
||||
|
Loading…
x
Reference in New Issue
Block a user