DEV Community

HarkiratShopism1
HarkiratShopism1

Posted on

How to use InventoryLevelService into a custom endpoint

InventoryLevelService is located at "medusa/packages/inventory/src/services/inventory-level.ts".
I tried to import it to the endpoint

My code
import { InventoryLevelService } from "@medusajs/inventory/dist/services";

export const customFn = async(req, res) => {
const manager: EntityManager = req.scope.resolve("manager");
const inventoryService = req.scope.resolve("inventoryService");
...
}

but getting error "AwilixResolutionError: Could not resolve 'InventoryLevelService'. Resolution path: InventoryLevelService".
while calling the endoint.

Top comments (0)