feat(admin-ui, medusa-js, medusa-react, medusa): Multiwarehousing UI (#3403)
* add "get-variant" endpoint * import from a different place * fix unit test * add changeset * inventory management for orders * add changeset * initial create-fulfillment * add changeset * type oas and admin * Move inv. creation and listing from admin repo * Fix location editing bug (CORE-1216) * Fix default warehouse on inventory table view * remove actions from each table line * Use feature flag hook instead of context directly * remove manage inventory action if inventory management is not enabled * Address review comments * fix queries made when inventorymodules are disabled * variant form changes for feature enabled * move exclamation icon into warning icon * ensure queries are not run unless feature is enabled for create-fulfillment --------- Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com> Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
This commit is contained in:
49 files changed
+3922
-722
No files matched your search
@@ -2,6 +2,9 @@ import {
|
||||
AdminGetVariantsVariantInventoryRes,
|
||||
AdminGetVariantsParams,
|
||||
AdminVariantsListRes,
|
||||
StoreGetVariantsVariantParams,
|
||||
AdminGetVariantParams,
|
||||
AdminVariantsRes,
|
||||
} from "@medusajs/medusa"
|
||||
import qs from "qs"
|
||||
import { ResponsePromise } from "../.."
|
||||
@@ -28,6 +31,27 @@ class AdminVariantsResource extends BaseResource {
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a product variant
|
||||
* @param id Query to filter variants by
|
||||
* @param customHeaders custom headers
|
||||
* @returns A list of variants satisfying the criteria of the query
|
||||
*/
|
||||
retrieve(
|
||||
id: string,
|
||||
query?: AdminGetVariantParams,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminVariantsRes> {
|
||||
let path = `/admin/variants/${id}`
|
||||
|
||||
if (query) {
|
||||
const queryString = qs.stringify(query)
|
||||
path = `/admin/variants?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param variantId id of the variant to fetch inventory for
|
||||
|
||||
Reference in new issue
Block a user