Skip to content

Commit

Permalink
SonarCloud issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
khanrn committed Apr 8, 2024
1 parent 1a950f1 commit 5210308
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Storage/Services/RegisterService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public RegisterService(
IAccessTokenGenerator accessTokenGenerator,
IOptions<GeneralSettings> generalSettings,
IOptions<PlatformSettings> platformSettings,
ILogger<IRegisterService> logger)
ILogger<RegisterService> logger)
{
httpClient.BaseAddress = new Uri(platformSettings.Value.ApiRegisterEndpoint);
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
Expand All @@ -70,13 +70,15 @@ public async Task<Party> GetParty(int partyId)
string accessToken = _accessTokenGenerator.GenerateAccessToken("platform", "events");

HttpResponseMessage response = await _client.GetAsync(token, endpointUrl, accessToken);
if (response.StatusCode == HttpStatusCode.OK)
HttpStatusCode responseHttpStatusCode = response.StatusCode;

if (responseHttpStatusCode == HttpStatusCode.OK)
{
party = await response.Content.ReadFromJsonAsync<Party>(_serializerOptions);
}
else
{
_logger.LogError("// Getting party with partyID {partyId} failed with statuscode {response.StatusCode}", partyId, response.StatusCode);
_logger.LogError("// Getting party with partyID {partyId} failed with statuscode {responseHttpStatusCode}", partyId, responseHttpStatusCode);

Check warning on line 81 in src/Storage/Services/RegisterService.cs

View workflow job for this annotation

GitHub Actions / Build, test & analyze

Use PascalCase for named placeholders. (https://rules.sonarsource.com/csharp/RSPEC-6678)
}

return party;
Expand Down

0 comments on commit 5210308

Please sign in to comment.