const express = require("express");
const router = express.Router();
const authorize = require("../../../../../middlewares/authorize-sapps");
const itemService = require("./item.service");

router.post("/get-items", authorize(), getItems);
router.post("/get-option-items", authorize(), getOptionItems);

module.exports = router;

function getItems(req, res, next) {
	itemService
		.getItems(req.body)
		.then((result) => res.json(result))
		.catch(next);
}

function getOptionItems(req, res, next) {
	itemService
		.getOptionItems(req.body)
		.then((result) => res.json(result))
		.catch(next);
}
