patched issues found during testing

This commit is contained in:
Laurin
2022-06-03 19:57:43 +02:00
parent 569695245f
commit 0f0da062c6
12 changed files with 74 additions and 36 deletions
+13 -2
View File
@@ -1,11 +1,22 @@
import Express from "express";
import { assignParticipantToRole, getRolesForTeam } from "../Controllers/role.controller";
import { requireAuthentication, requireConfiguredAuthentication } from "../Middleware/auth/auth";
const router = Express.Router();
//TO DO: maybe transfer getRolesForTeam to team router -> Seconded
router.get<"team/:teamPid/", { teamPid: string }>("team/:teamPid/", getRolesForTeam);
router.get<"team/:teamPid/", { teamPid: string }>(
"team/:teamPid/",
requireAuthentication,
requireConfiguredAuthentication({ optional: true, type: { admin: true, teamleader: true } }),
getRolesForTeam
);
router.put<"/:pid/participant", { pid: string }>("/:pid/participant", assignParticipantToRole);
router.put<"/:pid/participant", { pid: string }>(
"/:pid/participant",
requireAuthentication,
requireConfiguredAuthentication({ optional: true, type: { admin: true, teamleader: true } }),
assignParticipantToRole
);
export default router;