Add team routes

This commit is contained in:
Stefan-5422
2022-05-30 20:58:16 +02:00
parent aa6f0825ac
commit 6f730d1214
3 changed files with 106 additions and 3 deletions
+5 -3
View File
@@ -1,12 +1,14 @@
import express from "express";
import { requireAuthentication } from "../Middleware/auth/auth";
import { requireAuthentication, requireConfiguredAuthentication } from "../Middleware/auth/auth";
import { requireTeamleaderAuthentication } from "../Middleware/auth/teamleaderAuth";
import { register } from "../Controllers/user_auth.controller";
import { deleteTeam, getTeam, getTeams, updateTeam } from "../Controllers/team.controller";
const router = express.Router();
router.post("/", requireAuthentication, requireTeamleaderAuthentication, register);
router.get("/", requireConfiguredAuthentication({ type: "admin", optional: false }), getTeams);
router.get("/:id", getTeam);
router.put("/", requireTeamleaderAuthentication, updateTeam);
router.delete<"/:pid/", { pid: string }>("/:pid/", requireAuthentication, requireTeamleaderAuthentication, deleteTeam);
export default router;