const express = require("express");
const router = express.Router();
const authorize = require("../../../../middlewares/authorize-sapps");
const territoryService = require("./territory.service");
const redisClient = require("../../../../redisClient");

router.post("/", authorize(), getTerritoryHierarchy);

module.exports = router;

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