adding team router/cont and participant router

This commit is contained in:
Laurin
2022-05-30 12:21:28 +02:00
parent cd0cb00106
commit 7dc9dd1558
5 changed files with 186 additions and 117 deletions
+30
View File
@@ -0,0 +1,30 @@
import express from "express";
import teamRouter from "./team.routes";
import { createParticipant, deleteParticipant, updateParticipant } from "../Controllers/participant.controller";
import { requireAuthentication } from "../Middleware/auth/auth";
import { requireTeamleaderAuthentication } from "../Middleware/auth/teamleaderAuth";
const router = express.Router();
teamRouter.post<"/:pid/participant/", { pid: string }>(
"/:pid/participant/",
requireAuthentication,
requireTeamleaderAuthentication,
createParticipant
);
teamRouter.patch<"/:pid/participant/", { pid: string }>(
"/:pid/participant/",
requireAuthentication,
requireTeamleaderAuthentication,
updateParticipant
);
teamRouter.delete<"/:pid/participant/", { pid: string }>(
"/:pid/participant/",
requireAuthentication,
requireTeamleaderAuthentication,
deleteParticipant
);
export default router;