Skip to content

Commit

Permalink
Removed useless checks
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalii-bezuhlyi committed Feb 9, 2024
1 parent 325d923 commit dd579ea
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions Apps.XTM/Actions/ProjectActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,28 +265,12 @@ public async Task<ProjectUsersResponse> GetProjectUsers([ActionParameter] Projec
var endpoint = $"{ApiEndpoints.Projects}/{project.ProjectId}{ApiEndpoints.Users}";
var projectUsers = await Client.ExecuteXtmWithJson<ProjectUsers>(endpoint, Method.Get, null, Creds);

if(projectUsers.ProjectManager is null)
throw new Exception("Project manager not found");

if(projectUsers.ProjectCreator is null)
throw new Exception("Project creator not found");

var projectUsersResponse = new ProjectUsersResponse
{
ProjectManager = await GetUserById(projectUsers.ProjectManager.UserId),
ProjectCreator = await GetUserById(projectUsers.ProjectCreator.UserId)
};

if (projectUsersResponse.ProjectManager is null)
{
throw new Exception("Project manager not found");
}

if (projectUsersResponse.ProjectCreator is null)
{
throw new Exception("Project creator not found");
}

foreach (var linguist in projectUsers.Linguists)
{
projectUsersResponse.Linguists.Add(await GetUserById(linguist.UserId));
Expand Down

0 comments on commit dd579ea

Please sign in to comment.