fix(medusa): use correct request and response types for batch location levels route (#11055)
Use HTTP types for request / response types of the new batch location levels route
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/medusa": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(medusa): use correct request and response types for batch location levels route
|
||||||
@@ -104,9 +104,25 @@ export interface AdminBatchUpdateInventoryItemsLocationLevels
|
|||||||
id?: string
|
id?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A list of inventory levels to create, update, or delete.
|
||||||
|
*/
|
||||||
export interface AdminBatchInventoryItemsLocationLevels {
|
export interface AdminBatchInventoryItemsLocationLevels {
|
||||||
|
/**
|
||||||
|
* The inventory levels to create.
|
||||||
|
*/
|
||||||
create: AdminBatchCreateInventoryItemsLocationLevels[]
|
create: AdminBatchCreateInventoryItemsLocationLevels[]
|
||||||
|
/**
|
||||||
|
* The inventory levels to update.
|
||||||
|
*/
|
||||||
update: AdminBatchUpdateInventoryItemsLocationLevels[]
|
update: AdminBatchUpdateInventoryItemsLocationLevels[]
|
||||||
|
/**
|
||||||
|
* The IDs of the inventory levels to delete.
|
||||||
|
*/
|
||||||
delete: string[]
|
delete: string[]
|
||||||
|
/**
|
||||||
|
* If enabled, the inventory levels will be deleted
|
||||||
|
* even if they have stocked quantity.
|
||||||
|
*/
|
||||||
force?: boolean
|
force?: boolean
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ export type AdminInventoryLevelListResponse = PaginatedResponse<{
|
|||||||
inventory_levels: InventoryLevel[]
|
inventory_levels: InventoryLevel[]
|
||||||
}>
|
}>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The result of creating, updating or deleting inventory levels.
|
||||||
|
*/
|
||||||
export interface AdminBatchInventoryItemLocationLevelsResponse {
|
export interface AdminBatchInventoryItemLocationLevelsResponse {
|
||||||
/**
|
/**
|
||||||
* The created inventory levels.
|
* The created inventory levels.
|
||||||
@@ -30,5 +33,8 @@ export interface AdminBatchInventoryItemLocationLevelsResponse {
|
|||||||
deleted?: string[]
|
deleted?: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The result of creating, updating or deleting inventory levels.
|
||||||
|
*/
|
||||||
export interface AdminBatchInventoryItemsLocationLevelsResponse
|
export interface AdminBatchInventoryItemsLocationLevelsResponse
|
||||||
extends AdminBatchInventoryItemLocationLevelsResponse {}
|
extends AdminBatchInventoryItemLocationLevelsResponse {}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { batchInventoryItemLevelsWorkflow } from "@medusajs/core-flows"
|
import { batchInventoryItemLevelsWorkflow } from "@medusajs/core-flows"
|
||||||
import { MedusaRequest, MedusaResponse } from "@medusajs/framework"
|
import { MedusaRequest, MedusaResponse } from "@medusajs/framework"
|
||||||
import { AdminBatchInventoryItemLevelsType } from "../../validators"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: MedusaRequest<AdminBatchInventoryItemLevelsType>,
|
req: MedusaRequest<HttpTypes.AdminBatchInventoryItemsLocationLevels>,
|
||||||
res: MedusaResponse
|
res: MedusaResponse<HttpTypes.AdminBatchInventoryItemsLocationLevelsResponse>
|
||||||
) => {
|
) => {
|
||||||
const body = req.validatedBody
|
const body = req.validatedBody
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user