using System.Text.Json; using HealthcareManagerUiWebAssem.Entities; using HealthcareManagerUiWebAssem.Models; using HealthcareManagerUiWebAssem.Services.RequestHttp; namespace HealthcareManagerUiWebAssem.Services.AdminUserManagement; public class AdminManagementService(IRequestHttpService requestHttpService) : IAdminManagementService { public async Task>> GetDoctors() { var response = await requestHttpService.GetAsync("/api/Doctors"); var responseContent = await response.Content.ReadAsStringAsync(); return JsonSerializer.Deserialize>>(responseContent, new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); } public async Task>> GetPatients() { var response = await requestHttpService.GetAsync("/api/Patients"); var responseContent = await response.Content.ReadAsStringAsync(); return JsonSerializer.Deserialize>>(responseContent, new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); } public async Task DeleteDoctor(Guid id) { var response = await requestHttpService.DeleteAsync($"/api/Doctors/{id}"); return response.IsSuccessStatusCode; } public async Task DeletePatient(Guid id) { var response = await requestHttpService.DeleteAsync($"/api/Patients/{id}"); return response.IsSuccessStatusCode; } }