|
|
@ -1,4 +1,5 @@
|
|
|
|
using Blazor.Models;
|
|
|
|
using Blazor.Models;
|
|
|
|
|
|
|
|
using Blazor.Pages;
|
|
|
|
using Blazor.ViewClasses;
|
|
|
|
using Blazor.ViewClasses;
|
|
|
|
using Blazored.LocalStorage;
|
|
|
|
using Blazored.LocalStorage;
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
@ -26,7 +27,7 @@ namespace Blazor.Services
|
|
|
|
public async Task<Chapter> GetById(int id)
|
|
|
|
public async Task<Chapter> GetById(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Get the current data
|
|
|
|
// Get the current data
|
|
|
|
var currentData = _http.GetFromJsonAsync<List<Chapter>>($"https://trusting-panini.87-106-126-109.plesk.page/api/chapters/qUOGkWdoPCgbmuqxIC8xiaX0rV1Pw1LoPafkaoHOgszEyD9P2vcOu493xCDZpAqO").Result;
|
|
|
|
var currentData = _http.GetFromJsonAsync<List<Chapter>>($"https://trusting-panini.87-106-126-109.plesk.page/api/chapters"+"/"+Token.TOKEN_ID).Result;
|
|
|
|
|
|
|
|
|
|
|
|
// Get the chapter int the list
|
|
|
|
// Get the chapter int the list
|
|
|
|
var chapter = currentData.FirstOrDefault(w => w.Id == id);
|
|
|
|
var chapter = currentData.FirstOrDefault(w => w.Id == id);
|
|
|
@ -86,7 +87,7 @@ namespace Blazor.Services
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Get the current data
|
|
|
|
// Get the current data
|
|
|
|
//var currentData = await _localStorage.GetItemAsync<List<Chapter>>("data");
|
|
|
|
//var currentData = await _localStorage.GetItemAsync<List<Chapter>>("data");
|
|
|
|
var currentData = _http.GetFromJsonAsync<List<Chapter>>($"https://trusting-panini.87-106-126-109.plesk.page/api/chapters/qUOGkWdoPCgbmuqxIC8xiaX0rV1Pw1LoPafkaoHOgszEyD9P2vcOu493xCDZpAqO").Result;
|
|
|
|
var currentData = _http.GetFromJsonAsync<List<Chapter>>($"https://trusting-panini.87-106-126-109.plesk.page/api/chapters"+"/"+Token.TOKEN_ID).Result;
|
|
|
|
|
|
|
|
|
|
|
|
// Get the chapter int the list
|
|
|
|
// Get the chapter int the list
|
|
|
|
var chapter = currentData.FirstOrDefault(w => w.Id == id);
|
|
|
|
var chapter = currentData.FirstOrDefault(w => w.Id == id);
|
|
|
@ -133,7 +134,7 @@ namespace Blazor.Services
|
|
|
|
public async Task<Administrator> GetAdminById(int id)
|
|
|
|
public async Task<Administrator> GetAdminById(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Get the current data
|
|
|
|
// Get the current data
|
|
|
|
var currentData = _http.GetFromJsonAsync<List<Administrator>>($"https://trusting-panini.87-106-126-109.plesk.page/api/administrators/qUOGkWdoPCgbmuqxIC8xiaX0rV1Pw1LoPafkaoHOgszEyD9P2vcOu493xCDZpAqO").Result;
|
|
|
|
var currentData = _http.GetFromJsonAsync<List<Administrator>>($"https://trusting-panini.87-106-126-109.plesk.page/api/administrators"+"/"+Token.TOKEN_ID).Result;
|
|
|
|
|
|
|
|
|
|
|
|
// Get the admin int the list
|
|
|
|
// Get the admin int the list
|
|
|
|
var admin = currentData.FirstOrDefault(w => w.Id == id);
|
|
|
|
var admin = currentData.FirstOrDefault(w => w.Id == id);
|
|
|
@ -226,7 +227,7 @@ namespace Blazor.Services
|
|
|
|
public async Task<Question> GetQuestionById(int id)
|
|
|
|
public async Task<Question> GetQuestionById(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Get the current data
|
|
|
|
// Get the current data
|
|
|
|
var currentData = _http.GetFromJsonAsync<List<Question>>($"https://trusting-panini.87-106-126-109.plesk.page/api/questions/qUOGkWdoPCgbmuqxIC8xiaX0rV1Pw1LoPafkaoHOgszEyD9P2vcOu493xCDZpAqO").Result;
|
|
|
|
var currentData = _http.GetFromJsonAsync<List<Question>>($"https://trusting-panini.87-106-126-109.plesk.page/api/questions"+"/"+Token.TOKEN_ID).Result;
|
|
|
|
|
|
|
|
|
|
|
|
// Get the question int the list
|
|
|
|
// Get the question int the list
|
|
|
|
var question = currentData.FirstOrDefault(w => w.Id == id);
|
|
|
|
var question = currentData.FirstOrDefault(w => w.Id == id);
|
|
|
@ -318,7 +319,7 @@ namespace Blazor.Services
|
|
|
|
public async Task<Player> GetPlayerById(int id)
|
|
|
|
public async Task<Player> GetPlayerById(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Get the current data
|
|
|
|
// Get the current data
|
|
|
|
var currentData = _http.GetFromJsonAsync<List<Player>>($"https://trusting-panini.87-106-126-109.plesk.page/api/players/qUOGkWdoPCgbmuqxIC8xiaX0rV1Pw1LoPafkaoHOgszEyD9P2vcOu493xCDZpAqO").Result;
|
|
|
|
var currentData = _http.GetFromJsonAsync<List<Player>>($"https://trusting-panini.87-106-126-109.plesk.page/api/players"+"/"+Token.TOKEN_ID).Result;
|
|
|
|
|
|
|
|
|
|
|
|
// Get the player in the list
|
|
|
|
// Get the player in the list
|
|
|
|
var player = currentData.FirstOrDefault(w => w.Id == id);
|
|
|
|
var player = currentData.FirstOrDefault(w => w.Id == id);
|
|
|
|