Add route to get participant for role

This commit is contained in:
Stephan
2022-06-09 16:23:54 +02:00
committed by La_Felx
parent 718c040517
commit 3a995c6b03
+8
View File
@@ -1,10 +1,12 @@
import express from "express";
import teamRouter from "./team.routes";
import roleRouter from "./role.routes";
import {
createParticipant,
deleteParticipant,
getAllParticipants,
getAllParticipantsParams,
getParticipantForRole,
updateParticipant,
} from "../Controllers/participant.controller";
import { requireAuthentication, requireConfiguredAuthentication } from "../Middleware/auth/auth";
@@ -25,6 +27,12 @@ teamRouter.get(
getAllParticipantsParams
);
roleRouter.get(
"/:rolePid/participant",
requireConfiguredAuthentication({ type: { admin: true, teamleader: true }, optional: false }),
getParticipantForRole
);
teamRouter.post<"/:teamPid/participants/", { teamPid: string }>(
"/:teamPid/participants/",
requireConfiguredAuthentication({ optional: true, type: { admin: true, teamleader: true } }),