mirror of
https://github.com/detleph/server.git
synced 2026-09-04 08:36:06 +02:00
Add route to get participant for role
This commit is contained in:
@@ -1,10 +1,12 @@
|
|||||||
import express from "express";
|
import express from "express";
|
||||||
import teamRouter from "./team.routes";
|
import teamRouter from "./team.routes";
|
||||||
|
import roleRouter from "./role.routes";
|
||||||
import {
|
import {
|
||||||
createParticipant,
|
createParticipant,
|
||||||
deleteParticipant,
|
deleteParticipant,
|
||||||
getAllParticipants,
|
getAllParticipants,
|
||||||
getAllParticipantsParams,
|
getAllParticipantsParams,
|
||||||
|
getParticipantForRole,
|
||||||
updateParticipant,
|
updateParticipant,
|
||||||
} from "../Controllers/participant.controller";
|
} from "../Controllers/participant.controller";
|
||||||
import { requireAuthentication, requireConfiguredAuthentication } from "../Middleware/auth/auth";
|
import { requireAuthentication, requireConfiguredAuthentication } from "../Middleware/auth/auth";
|
||||||
@@ -25,6 +27,12 @@ teamRouter.get(
|
|||||||
getAllParticipantsParams
|
getAllParticipantsParams
|
||||||
);
|
);
|
||||||
|
|
||||||
|
roleRouter.get(
|
||||||
|
"/:rolePid/participant",
|
||||||
|
requireConfiguredAuthentication({ type: { admin: true, teamleader: true }, optional: false }),
|
||||||
|
getParticipantForRole
|
||||||
|
);
|
||||||
|
|
||||||
teamRouter.post<"/:teamPid/participants/", { teamPid: string }>(
|
teamRouter.post<"/:teamPid/participants/", { teamPid: string }>(
|
||||||
"/:teamPid/participants/",
|
"/:teamPid/participants/",
|
||||||
requireConfiguredAuthentication({ optional: true, type: { admin: true, teamleader: true } }),
|
requireConfiguredAuthentication({ optional: true, type: { admin: true, teamleader: true } }),
|
||||||
|
|||||||
Reference in New Issue
Block a user