mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
add to cart c:
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
import type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next'
|
||||
import { BigcommerceConfig, getConfig } from '..'
|
||||
|
||||
export type BigcommerceApiHandler = (
|
||||
export type BigcommerceApiHandler<T = any> = (
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse,
|
||||
res: NextApiResponse<BigcommerceApiResponse<T>>,
|
||||
config: BigcommerceConfig
|
||||
) => void | Promise<void>
|
||||
|
||||
export type BigcommerceApiResponse<T> = {
|
||||
data: T | null
|
||||
errors?: { message: string }[]
|
||||
}
|
||||
|
||||
export default function createApiHandler(handler: BigcommerceApiHandler) {
|
||||
return function getApiHandler({
|
||||
config,
|
||||
|
Reference in New Issue
Block a user