diff --git a/WardrobeManager.Presentation/Services/Implementation/ApiService.cs b/WardrobeManager.Presentation/Services/Implementation/ApiService.cs index 38f63ec..2a90f5d 100644 --- a/WardrobeManager.Presentation/Services/Implementation/ApiService.cs +++ b/WardrobeManager.Presentation/Services/Implementation/ApiService.cs @@ -30,12 +30,14 @@ public async Task> GetAllClothingItemsAsync() public async Task AddNewClothingItemAsync(NewClothingItemDTO newNewClothingItem) { - await _httpClient.PostAsJsonAsync("/clothing/add", newNewClothingItem); + var response = await _httpClient.PostAsJsonAsync("/clothing/add", newNewClothingItem); + response.EnsureSuccessStatusCode(); } public async Task DeleteClothingItemAsync(int itemId) { - await _httpClient.PostAsJsonAsync("/clothing/delete", itemId); + var response = await _httpClient.PostAsJsonAsync("/clothing/delete", itemId); + response.EnsureSuccessStatusCode(); } #endregion