Skip to content

Commit

Permalink
fix: request team
Browse files Browse the repository at this point in the history
  • Loading branch information
DevNono committed Nov 20, 2023
1 parent 668888a commit 68250e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/controllers/teams/createTeamRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export default [
if (!team) return notFound(response, ResponseError.TeamNotFound);

// Check if the team is not locked
if (team.lockedAt && user.type !== UserType.coach) return forbidden(response, ResponseError.TeamLocked);
if (team.lockedAt && request.body.userType !== UserType.coach)
return forbidden(response, ResponseError.TeamLocked);

// Check if the user is already asking for a team
if (user.askingTeamId) return forbidden(response, ResponseError.AlreadyAskedATeam);
Expand Down

0 comments on commit 68250e9

Please sign in to comment.