Skip to content

Commit

Permalink
Merge pull request #765 from bcgov/BCPSDEMS-2201-delegate-access
Browse files Browse the repository at this point in the history
debugging
  • Loading branch information
leewrigh authored Feb 6, 2025
2 parents 490d920 + 53ef588 commit 4749d94
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -575,16 +575,18 @@ public async Task<bool> AddUserToCase(string userKey, int caseId)

if (userOnCase != null)
{
this.logger.LogInformation("User user {0} already assigned to case {0}", userKey, caseId);
this.logger.LogInformation($"User {userKey} already assigned to case {caseId}");
return true;
}
else
{
this.logger.LogInformation("Adding user {0} to case {0}", userKey, caseId);
this.logger.LogInformation($"Adding user {userKey} to case {caseId}");
var result = await this.PostAsync($"api/v1/cases/{caseId}/users/{userKey}");
if (result.IsSuccess)
{
this.logger.LogInformation("Successfully added user {0} to case {1}", userKey, caseId);
this.logger.LogInformation($"Successfully added user {userKey} to case {caseId}");
var userCases = await this.GetUserCases(userKey);
this.logger.LogInformation($"User {userKey} now has access to {userCases.Count()} cases");
return true;
}
else
Expand Down Expand Up @@ -859,7 +861,9 @@ public async Task<IEnumerable<KeyIdPair>> GetUserCases(string userIdOrKey)
{
this.logger.LogInformation($"Getting cases for user {userIdOrKey} org-unit {this.EdtOrgUnitId}");

var response = await this.GetAsync<IEnumerable<KeyIdPair>>($"api/v1/org-units/{this.EdtOrgUnitId}/users/{userIdOrKey}/cases");
var apiCall = $"api/v1/org-units/{this.EdtOrgUnitId}/users/{userIdOrKey}/cases";
this.logger.LogInformation($"Calling API {apiCall}");
var response = await this.GetAsync<IEnumerable<KeyIdPair>>(apiCall);

if (response.IsSuccess)
{
Expand Down

0 comments on commit 4749d94

Please sign in to comment.