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:
5
.changeset/purple-schools-listen.md
Normal file
5
.changeset/purple-schools-listen.md
Normal file
@@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of inventory levels to create, update, or delete.
|
||||
*/
|
||||
export interface AdminBatchInventoryItemsLocationLevels {
|
||||
/**
|
||||
* The inventory levels to create.
|
||||
*/
|
||||
create: AdminBatchCreateInventoryItemsLocationLevels[]
|
||||
/**
|
||||
* The inventory levels to update.
|
||||
*/
|
||||
update: AdminBatchUpdateInventoryItemsLocationLevels[]
|
||||
/**
|
||||
* The IDs of the inventory levels to delete.
|
||||
*/
|
||||
delete: string[]
|
||||
/**
|
||||
* If enabled, the inventory levels will be deleted
|
||||
* even if they have stocked quantity.
|
||||
*/
|
||||
force?: boolean
|
||||
}
|
||||
|
||||
@@ -15,6 +15,9 @@ export type AdminInventoryLevelListResponse = PaginatedResponse<{
|
||||
inventory_levels: InventoryLevel[]
|
||||
}>
|
||||
|
||||
/**
|
||||
* The result of creating, updating or deleting inventory levels.
|
||||
*/
|
||||
export interface AdminBatchInventoryItemLocationLevelsResponse {
|
||||
/**
|
||||
* The created inventory levels.
|
||||
@@ -30,5 +33,8 @@ export interface AdminBatchInventoryItemLocationLevelsResponse {
|
||||
deleted?: string[]
|
||||
}
|
||||
|
||||
/**
|
||||
* The result of creating, updating or deleting inventory levels.
|
||||
*/
|
||||
export interface AdminBatchInventoryItemsLocationLevelsResponse
|
||||
extends AdminBatchInventoryItemLocationLevelsResponse {}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { batchInventoryItemLevelsWorkflow } from "@medusajs/core-flows"
|
||||
import { MedusaRequest, MedusaResponse } from "@medusajs/framework"
|
||||
import { AdminBatchInventoryItemLevelsType } from "../../validators"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const POST = async (
|
||||
req: MedusaRequest<AdminBatchInventoryItemLevelsType>,
|
||||
res: MedusaResponse
|
||||
req: MedusaRequest<HttpTypes.AdminBatchInventoryItemsLocationLevels>,
|
||||
res: MedusaResponse<HttpTypes.AdminBatchInventoryItemsLocationLevelsResponse>
|
||||
) => {
|
||||
const body = req.validatedBody
|
||||
|
||||
|
||||
Reference in New Issue
Block a user