Skip to content

Capture HTTP response status for PostAsJsonAsync calls in ApiService#99

Closed
Copilot wants to merge 2 commits intoUS-003from
copilot/sub-pr-98
Closed

Capture HTTP response status for PostAsJsonAsync calls in ApiService#99
Copilot wants to merge 2 commits intoUS-003from
copilot/sub-pr-98

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

AddNewClothingItemAsync and DeleteClothingItemAsync were discarding the HttpResponseMessage returned by PostAsJsonAsync, silently swallowing server-side failures.

Changes

  • Capture the HttpResponseMessage from PostAsJsonAsync and call EnsureSuccessStatusCode() in both methods, consistent with the existing pattern used in AddLog and CreateAdminUserIfMissing
// Before
await _httpClient.PostAsJsonAsync<int>("/clothing/delete", itemId);

// After
var response = await _httpClient.PostAsJsonAsync<int>("/clothing/delete", itemId);
response.EnsureSuccessStatusCode();

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@deepsource-io
Copy link
Contributor

deepsource-io bot commented Feb 28, 2026

DeepSource Code Review

We reviewed changes in 1e0224d...d0f7fe1 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
C# Feb 28, 2026 3:01a.m. Review ↗
Test coverage Feb 28, 2026 3:01a.m. Review ↗

Co-authored-by: m-GDEV <65223925+m-GDEV@users.noreply.github.com>
Copilot AI changed the title [WIP] Update handling of HTTP response code in US-003 Capture HTTP response status for PostAsJsonAsync calls in ApiService Feb 28, 2026
@m-GDEV
Copy link
Owner

m-GDEV commented Feb 28, 2026

Did in #98

@m-GDEV m-GDEV closed this Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants