feat(core-flows,types,medusa): validate deleting location level when quantities exist (#9086)
what: - adds validation in workflow to prevent deleting a location level when reserved or stocked quantity exists - disabled delete button when quantities exist - consolidate delete workflows <img width="1079" alt="Screenshot 2024-09-10 at 16 39 02" src="https://github.com/user-attachments/assets/cf1f4b2e-75ea-4f7c-9b97-24622396c632"> RESOLVES CC-120
This commit is contained in:
+2
-2
@@ -9,9 +9,9 @@ import {
|
||||
deleteInventoryLevelsWorkflow,
|
||||
updateInventoryLevelsWorkflow,
|
||||
} from "@medusajs/core-flows"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
import { refetchInventoryItem } from "../../../helpers"
|
||||
import { AdminUpdateInventoryLocationLevelType } from "../../../validators"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
export const DELETE = async (
|
||||
req: MedusaRequest,
|
||||
@@ -45,7 +45,7 @@ export const DELETE = async (
|
||||
|
||||
await deleteInventoryLevelWorkflow.run({
|
||||
input: {
|
||||
ids: [levelId],
|
||||
id: [levelId],
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user