chore(oas): fix Get Variant's Inventory OAS (#4856)

* chore(oas): fix Get Variant's Inventory OAS

* fix the curl example
This commit is contained in:
Shahed Nasser
2023-08-25 13:03:55 +03:00
committed by GitHub
parent 819d27e774
commit d04b9635f9
@@ -29,14 +29,14 @@ import { joinLevels } from "../inventory-items/utils/join-levels"
* import Medusa from "@medusajs/medusa-js" * import Medusa from "@medusajs/medusa-js"
* const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
* // must be previously logged in or use api token * // must be previously logged in or use api token
* medusa.admin.variants.list() * medusa.admin.variants.getInventory(variantId)
* .then(({ variants, limit, offset, count }) => { * .then(({ variant }) => {
* console.log(variants.length) * console.log(variant.inventory, variant.sales_channel_availability)
* }) * })
* - lang: Shell * - lang: Shell
* label: cURL * label: cURL
* source: | * source: |
* curl '{backend_url}/admin/variants' \ * curl '{backend_url}/admin/variants/{id}/inventory' \
* -H 'Authorization: Bearer {api_token}' * -H 'Authorization: Bearer {api_token}'
* security: * security:
* - api_token: [] * - api_token: []
@@ -49,11 +49,7 @@ import { joinLevels } from "../inventory-items/utils/join-levels"
* content: * content:
* application/json: * application/json:
* schema: * schema:
* type: object * $ref: "#/components/schemas/AdminGetVariantsVariantInventoryRes"
* properties:
* variant:
* type: object
* $ref: "#/components/schemas/AdminGetVariantsVariantInventoryRes"
* "400": * "400":
* $ref: "#/components/responses/400_error" * $ref: "#/components/responses/400_error"
* "401": * "401":