fix: medusa-js complete cart types + oas comments (#889)
This commit is contained in:
@@ -1,10 +1,12 @@
|
|||||||
import {
|
import {
|
||||||
StoreCartsRes,
|
StoreCartsRes,
|
||||||
|
StoreOrdersRes,
|
||||||
StorePostCartReq,
|
StorePostCartReq,
|
||||||
StorePostCartsCartPaymentSessionReq,
|
StorePostCartsCartPaymentSessionReq,
|
||||||
StorePostCartsCartPaymentSessionUpdateReq,
|
StorePostCartsCartPaymentSessionUpdateReq,
|
||||||
StorePostCartsCartReq,
|
StorePostCartsCartReq,
|
||||||
StorePostCartsCartShippingMethodReq,
|
StorePostCartsCartShippingMethodReq,
|
||||||
|
StoreSwapsRes,
|
||||||
} from "@medusajs/medusa"
|
} from "@medusajs/medusa"
|
||||||
import { ResponsePromise } from "../typings"
|
import { ResponsePromise } from "../typings"
|
||||||
import BaseResource from "./base"
|
import BaseResource from "./base"
|
||||||
@@ -34,9 +36,11 @@ class CartsResource extends BaseResource {
|
|||||||
* The completion of a cart can be performed idempotently with a provided header Idempotency-Key.
|
* The completion of a cart can be performed idempotently with a provided header Idempotency-Key.
|
||||||
* If not provuided, we will generate one for the request.
|
* If not provuided, we will generate one for the request.
|
||||||
* @param {string} cart_id is required
|
* @param {string} cart_id is required
|
||||||
* @return {ResponsePromise<StoreCartsRes>}
|
* @return {ResponsePromise<StoreCartsRes | StoreSwapsRes | StoreOrdersRes>}
|
||||||
*/
|
*/
|
||||||
complete(cart_id: string): ResponsePromise<StoreCartsRes> {
|
complete(
|
||||||
|
cart_id: string
|
||||||
|
): ResponsePromise<StoreCartsRes | StoreSwapsRes | StoreOrdersRes> {
|
||||||
const path = `/store/carts/${cart_id}/complete`
|
const path = `/store/carts/${cart_id}/complete`
|
||||||
return this.client.request("POST", path)
|
return this.client.request("POST", path)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ import {
|
|||||||
* properties:
|
* properties:
|
||||||
* cart:
|
* cart:
|
||||||
* $ref: "#/components/schemas/cart"
|
* $ref: "#/components/schemas/cart"
|
||||||
|
* - type: object
|
||||||
|
* properties:
|
||||||
|
* cart:
|
||||||
|
* $ref: "#/components/schemas/swap"
|
||||||
*/
|
*/
|
||||||
export default async (req, res) => {
|
export default async (req, res) => {
|
||||||
const { id } = req.params
|
const { id } = req.params
|
||||||
|
|||||||
Reference in New Issue
Block a user