Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Apr 27, 2024
1 parent b48de52 commit 763d65f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions routes/teams/endpoints/edit_team_member/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,18 @@ func Route(d uapi.RouteData, r *http.Request) uapi.HttpResponse {
}
}

if count != 2 {
if d.Auth.ID != userId {
if count != 2 {
return uapi.HttpResponse{
Status: http.StatusBadRequest,
Json: types.ApiError{Message: "Either the manager or the user is not on this team"},
}
}
// count == 1 if the user is the manager
} else if count != 1 {
return uapi.HttpResponse{
Status: http.StatusBadRequest,
Json: types.ApiError{Message: "Either the manager or the user is not on this team"},
Json: types.ApiError{Message: "User is not on this team"},
}
}

Expand Down

0 comments on commit 763d65f

Please sign in to comment.