Обновил api
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
using System.Diagnostics;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using PaydayFrontend.Models;
|
||||
|
||||
namespace PaydayFrontend.Controllers;
|
||||
@ -13,9 +14,17 @@ public class HomeController : Controller
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public IActionResult Index()
|
||||
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
return View();
|
||||
using HttpClient client = new();
|
||||
|
||||
string json = await client.GetStringAsync(
|
||||
"https://payday.zetcraft.ru/v1/public/university");
|
||||
|
||||
List<University> universities = JsonConvert.DeserializeObject<List<University>>(json);
|
||||
|
||||
return View(universities);
|
||||
}
|
||||
|
||||
public IActionResult SecondPage()
|
||||
|
Reference in New Issue
Block a user