Fix error before M7
This commit is contained in:
@@ -54,7 +54,17 @@ export interface CommerceResource {
|
||||
removeCartLine(locale: Locale, variantId: string, options?: RequestOptions): Promise<Cart>;
|
||||
|
||||
getCheckoutQuote(locale: Locale, options?: RequestOptions): Promise<Cart>;
|
||||
placeOrder(locale: Locale, input: PlaceOrderInput, options?: RequestOptions): Promise<Order>;
|
||||
/**
|
||||
* `idempotencyKey` must be stable across retries of the *same* attempt and
|
||||
* different between attempts — the server uses it to tell a resend apart from
|
||||
* a second purchase.
|
||||
*/
|
||||
placeOrder(
|
||||
locale: Locale,
|
||||
idempotencyKey: string,
|
||||
input: PlaceOrderInput,
|
||||
options?: RequestOptions,
|
||||
): Promise<Order>;
|
||||
lookupOrder(orderNumber: string, email: string, options?: RequestOptions): Promise<Order>;
|
||||
getPlacedOrder(id: string, options?: RequestOptions): Promise<Order>;
|
||||
}
|
||||
@@ -112,8 +122,11 @@ export function createCommerceResource(http: HttpClient): CommerceResource {
|
||||
getCheckoutQuote: (locale, options) =>
|
||||
http.get<Cart>('/checkout/quote', cartOptions(locale, options)),
|
||||
|
||||
placeOrder: (locale, input, options) =>
|
||||
http.post<Order>('/checkout/orders', input, cartOptions(locale, options)),
|
||||
placeOrder: (locale, idempotencyKey, input, options) =>
|
||||
http.post<Order>('/checkout/orders', input, {
|
||||
...cartOptions(locale, options),
|
||||
headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
|
||||
}),
|
||||
|
||||
getPlacedOrder: (id, options) =>
|
||||
http.get<Order>(`/checkout/orders/${encodeURIComponent(id)}`, {
|
||||
|
||||
Reference in New Issue
Block a user