From 25f715bd3a07346337d73b6082e98a4e0e84c3a8 Mon Sep 17 00:00:00 2001 From: Sathishkumar Krishnan Date: Tue, 25 Jan 2022 15:16:42 +0530 Subject: [PATCH] feat: added inventory types get api --- src/controller/inventory.controller.js | 7 +++++++ src/controller/inventory.router.js | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/src/controller/inventory.controller.js b/src/controller/inventory.controller.js index f1a1e81..3a01bdd 100644 --- a/src/controller/inventory.controller.js +++ b/src/controller/inventory.controller.js @@ -3,6 +3,13 @@ const WidgetFamily = require("../models/WidgetFamily"); const { InventoryTypes } = require("../config/constants"); module.exports = { + /** + * Gets the Inventory types + */ + getInventoryTypes: async (req, res, next) => { + res.send({ success: true, data: InventoryTypes }); + }, + /** * Gets the Inventory data by `id` */ diff --git a/src/controller/inventory.router.js b/src/controller/inventory.router.js index f90000a..0beed4b 100644 --- a/src/controller/inventory.router.js +++ b/src/controller/inventory.router.js @@ -11,6 +11,11 @@ router.post("/", controller.createInventory); */ router.patch("/:id", controller.updateInventoryByID); +/** + * @route /inventory/types + */ +router.get("/types", controller.getInventoryTypes); + /** * @route /inventory/filter-by-type */