import express from "express";
import svc from "~/services/item/bundle";

// eslint-disable-next-line new-cap
const router = express.Router();

router.get("/", async function (req, res, next) {
	res.json(await svc.getBlank());
});

router.get("/:id", async function (req, res, next) {
	res.json(await svc.get(req.params.id));
});

router.post("/", async function (req, res, next) {
	res.json(await svc.create());
});

router.patch("/:id", async function (req, res, next) {
	res.json(await svc.patch(req.params.id, req.body));
});

export default router;
