working on edit form

This commit is contained in:
2026-03-22 21:01:54 +01:00
parent 7594d179a8
commit 65fa420306
9 changed files with 174 additions and 6 deletions
@@ -24,9 +24,32 @@ namespace CityInfo.WEB.Services
throw new NotImplementedException();
}
public Task<PointOfInterest?> GetPointOfInterest(int cityId, int pointOfInterestId)
public async Task<PointOfInterest?> GetPointOfInterest(int cityId, int pointOfInterestId)
{
throw new NotImplementedException();
try
{
var response = await _httpClient.GetAsync($"/api/cities/{cityId}/pointsofinterest/{pointOfInterestId}");
if (response.IsSuccessStatusCode)
{
return await response.Content.ReadFromJsonAsync<PointOfInterest>();
}
if (response.StatusCode == System.Net.HttpStatusCode.NotFound)
{
return null;
}
_logger.LogWarning($"Erreur HTTP {response.StatusCode} lors du chargement du point d'intéret {pointOfInterestId}",
response.StatusCode, cityId);
return null;
}
catch (Exception ex)
{
_logger.LogError(ex, $"Erreur lors de la récupération du point d'intéret {pointOfInterestId}", cityId);
return null;
}
}
public async Task<IEnumerable<PointOfInterest>> GetPointsOfInterest(int cityId)