WIP: Record history

This commit is contained in:
2025-12-01 18:37:09 +01:00
parent c8ded1f0a4
commit 0c6848556b
11 changed files with 1176 additions and 0 deletions

View File

@@ -90,4 +90,32 @@ public class LayerService
var response = await _httpClient.DeleteAsync($"Layers/{layerId}/records/{recordId}");
return response.IsSuccessStatusCode;
}
public async Task<List<RecordHistoryDto>> GetRecordHistoryAsync(Guid layerId, Guid recordId)
{
var response = await _httpClient.GetAsync($"Layers/{layerId}/records/{recordId}/history");
if (!response.IsSuccessStatusCode)
{
var error = await response.Content.ReadAsStringAsync();
Console.Error.WriteLine($"GetRecordHistoryAsync failed: {response.StatusCode} - {error}");
return new List<RecordHistoryDto>();
}
return await response.Content.ReadFromJsonAsync<List<RecordHistoryDto>>() ?? new List<RecordHistoryDto>();
}
public async Task<List<DeletedRecordDto>> GetDeletedRecordsAsync(Guid layerId)
{
var response = await _httpClient.GetAsync($"Layers/{layerId}/records/deleted");
if (!response.IsSuccessStatusCode)
{
var error = await response.Content.ReadAsStringAsync();
Console.Error.WriteLine($"GetDeletedRecordsAsync failed: {response.StatusCode} - {error}");
return new List<DeletedRecordDto>();
}
return await response.Content.ReadFromJsonAsync<List<DeletedRecordDto>>() ?? new List<DeletedRecordDto>();
}
}