|
|
@ -27,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>>(API.API_URL+"chapters"+"/"+API.TOKEN).Result;
|
|
|
|
var currentData = _http.GetFromJsonAsync<List<Chapter>>(API.API_URL+"chapters/"+API.TOKEN).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);
|
|
|
@ -87,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>>(API.API_URL+"chapters"+"/"+API.TOKEN).Result;
|
|
|
|
var currentData = _http.GetFromJsonAsync<List<Chapter>>(API.API_URL+"chapters/"+API.TOKEN).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);
|
|
|
@ -134,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>>(API.API_URL+"administrators"+"/"+API.TOKEN).Result;
|
|
|
|
var currentData = _http.GetFromJsonAsync<List<Administrator>>(API.API_URL+"administrators/"+API.TOKEN).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);
|
|
|
@ -227,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>>(API.API_URL+"questions"+"/"+API.TOKEN).Result;
|
|
|
|
var currentData = _http.GetFromJsonAsync<List<Question>>(API.API_URL+"questions/"+API.TOKEN).Result;
|
|
|
|
|
|
|
|
|
|
|
|
// Get the question int the list
|
|
|
|
// Get the question int the list
|
|
|
|
var question = currentData.FirstOrDefault(w => w.Q_id == id);
|
|
|
|
var question = currentData.FirstOrDefault(w => w.Q_id == id);
|
|
|
@ -319,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>>(API.API_URL+"players"+"/"+API.TOKEN).Result;
|
|
|
|
var currentData = _http.GetFromJsonAsync<List<Player>>(API.API_URL+"players/"+API.TOKEN).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);
|
|
|
|