Подготовил направления
This commit is contained in:
@ -6,6 +6,7 @@ namespace PaydayFrontend.Services;
|
||||
public interface IUniversityService
|
||||
{
|
||||
public Task<List<University>> GetAllUniversity();
|
||||
public Task<List<University>> GetDirectionsByUniversityId();
|
||||
}
|
||||
|
||||
public class UniversityService : IUniversityService
|
||||
@ -28,4 +29,15 @@ public class UniversityService : IUniversityService
|
||||
});
|
||||
return university;
|
||||
}
|
||||
|
||||
public async Task<List<University>> GetDirectionsByUniversityId()
|
||||
{
|
||||
var response = await _httpClient.GetAsync("v1/public/university");
|
||||
var result = await response.Content.ReadAsStringAsync();
|
||||
var university = JsonSerializer.Deserialize<List<University>>(result, new JsonSerializerOptions
|
||||
{
|
||||
PropertyNameCaseInsensitive = true
|
||||
});
|
||||
return university;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user