import express from "express";
import itemBundleService from "~/services/item/bundles";

// eslint-disable-next-line new-cap
const router = express.Router();

router.get("/", async function (req, res) {
	res.json(await itemBundleService.getList());
});

// router.get("/details", async function (req, res) {
// 	res.json(await itemBundleService.getListDetails());
// });

router.post("/addItem", async function (req, res) {
	res.json(await itemBundleService.addItemToBundle(req.body));
});

router.post("/", async function (req, res) {
	res.json(await itemBundleService.create(req.body));
});

// router.put("/:id", async function (req, res) {
// 	res.json(await itemBundleService.update(req.params.id, req.body));
// });

router.patch("/:id", async function (req, res) {
	res.json(await itemBundleService.patch(req.params.id, req.body));
});

// router.delete("/:id", async function (req, res) {
// 	res.json(await itemBundleService.remove(req.params.id));
// });

export default router;
