Skip to content

Commit

Permalink
Merge pull request #199 from ungdev/dev
Browse files Browse the repository at this point in the history
fix: request team
  • Loading branch information
DevNono authored Nov 20, 2023
2 parents f9f44fe + b7f2ebb commit b8f0dca
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 b8f0dca

Please sign in to comment.