import { Router } from "express";
import { requireAuth } from "../../../../pkg/middleware/authMiddleware.js";
import { restrictToHosts } from "../../../../pkg/middleware/restrictToHosts.js";
import addCompany from "./addCompany.js";
import getCompanies from "./getCompanies.js";
import updateCompany from "./updateServer.js";

const router = Router();

router.use(
	"/",
	requireAuth("forklifts", ["systemAdmin", "admin"]),
	getCompanies,
);
router.use("/", requireAuth("forklifts", ["systemAdmin", "admin"]), addCompany);
router.use(
	"/",
	requireAuth("forklifts", ["systemAdmin", "admin"]),
	updateCompany,
);

export default router;
