mirror of
https://github.com/detleph/server.git
synced 2026-09-09 23:44:51 +02:00
Add team routes
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user