mirror of
https://github.com/vercel/commerce.git
synced 2025-06-19 05:31:22 +00:00
Updated fetch type
This commit is contained in:
parent
3b74f8d854
commit
874cf9d5b3
@ -107,7 +107,7 @@ export type GetCartHook<T extends CartTypes = CartTypes> = {
|
||||
|
||||
export type AddItemHook<T extends CartTypes = CartTypes> = {
|
||||
data: T['cart']
|
||||
input: T['itemBody']
|
||||
input?: T['itemBody']
|
||||
fetcherInput: T['itemBody']
|
||||
body: { item: T['itemBody'] }
|
||||
actionInput: T['itemBody']
|
||||
|
@ -43,7 +43,10 @@ export type HookFetcherFn<H extends HookSchemaBase> = (
|
||||
export type HookFetcherContext<H extends HookSchemaBase> = {
|
||||
options: HookFetcherOptions
|
||||
input: H['fetcherInput']
|
||||
fetch: <T = H['fetchData'], B = H['body']>(
|
||||
fetch: <
|
||||
T = H['fetchData'] extends {} | null ? H['fetchData'] : any,
|
||||
B = H['body']
|
||||
>(
|
||||
options: FetcherOptions<B>
|
||||
) => Promise<T>
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user