Skip to content

Commit a3d61d7

Browse files
committed
teamRoutes for bot
1 parent b861228 commit a3d61d7

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

backend/src/controllers/team.controller.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,18 @@ export const getTeams = async (req: Request, res: Response) => {
7272
}
7373
};
7474

75+
export const getTeamsWithfactions = async (req: Request, res: Response) => {
76+
77+
try {
78+
const teams = await team_service.getTeamsAll();
79+
Ok(res, { data: teams });
80+
return;
81+
82+
} catch (error) {
83+
Error(res, { msg: "Erreur lors de la récupération des équipes et de leur faction." });
84+
}
85+
};
86+
7587
export const modifyTeam = async (req: Request, res: Response) => {
7688
try {
7789
const { teamID, teamName, teamMembers, factionID, type } = req.body;

backend/src/routes/team.routes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ teamRouter.post("/user/create",checkRole("Student") ,teamController.createNewTea
1212
//Admin Routes
1313
teamRouter.post("/admin/createlight",checkRole("Admin") ,teamController.createNewTeamLight);
1414
teamRouter.get("/admin/teams",checkRole("Admin") ,teamController.getTeams);
15+
teamRouter.get("/admin/teamswithfactions",checkRole("Admin") ,teamController.getTeamsWithfactions);
1516
teamRouter.get("/admin/teamfaction",checkRole("Admin") ,teamController.getTeamFaction);
1617
teamRouter.put("/admin/modify",checkRole("Admin") ,teamController.modifyTeam);
1718
teamRouter.get("/admin/teamusers",checkRole("Admin") ,teamController.getTeamUsers);

0 commit comments

Comments
 (0)