mirror of
https://github.com/detleph/server.git
synced 2026-09-04 08:36:06 +02:00
patched requireLeaderOfTeam usecases
This commit is contained in:
@@ -32,7 +32,7 @@ export const getTeams = async (req: Request, res: Response) => {
|
||||
res.status(200).json({ type: "success", payload: { teams } });
|
||||
};
|
||||
|
||||
export const getTeam = async (req: Request, res: Response) => {
|
||||
export const getTeam = async (req: Request<{ pid: string }>, res: Response) => {
|
||||
const { pid } = req.params;
|
||||
|
||||
if (req.teamleader?.isAuthenticated) {
|
||||
@@ -44,6 +44,10 @@ export const getTeam = async (req: Request, res: Response) => {
|
||||
select: basicTeam,
|
||||
});
|
||||
|
||||
if (!team) {
|
||||
throw new NotFoundError("team", pid);
|
||||
}
|
||||
|
||||
res.status(200).json({ type: "success", payload: { team } });
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user