|
|
|
@ -17,28 +17,28 @@ namespace Blazor.Pages.Questions;
|
|
|
|
|
|
|
|
|
|
public partial class Questions
|
|
|
|
|
{
|
|
|
|
|
public List<Question> questions;
|
|
|
|
|
public List<Question> questions = new();
|
|
|
|
|
|
|
|
|
|
private int totalQuestion;
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
public NavigationManager NavigationManager { get; set; }
|
|
|
|
|
public required NavigationManager NavigationManager { get; set; }
|
|
|
|
|
|
|
|
|
|
[CascadingParameter]
|
|
|
|
|
public IModalService Modal { get; set; }
|
|
|
|
|
public required IModalService Modal { get; set; }
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
public IDataService DataService { get; set; }
|
|
|
|
|
public IWebHostEnvironment WebHostEnvironment { get; set; }
|
|
|
|
|
public required IDataService DataService { get; set; }
|
|
|
|
|
public required IWebHostEnvironment WebHostEnvironment { get; set; }
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
public HttpClient Http { get; set; }
|
|
|
|
|
public required HttpClient Http { get; set; }
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
public ILocalStorageService LocalStorage { get; set; }
|
|
|
|
|
public required ILocalStorageService LocalStorage { get; set; }
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
public IJSRuntime IJSRuntime { get; set; }
|
|
|
|
|
public required IJSRuntime IJSRuntime { get; set; }
|
|
|
|
|
|
|
|
|
|
private async void OnDelete(int id)
|
|
|
|
|
{
|
|
|
|
@ -82,7 +82,7 @@ public partial class Questions
|
|
|
|
|
|
|
|
|
|
var response = Http.GetFromJsonAsync<Question[]>(API.API_URL+"questions/"+API.TOKEN).Result;
|
|
|
|
|
|
|
|
|
|
if (!e.CancellationToken.IsCancellationRequested)
|
|
|
|
|
if (!e.CancellationToken.IsCancellationRequested && response != null)
|
|
|
|
|
{
|
|
|
|
|
questions = new List<Question>(response); // an actual data for the current page
|
|
|
|
|
|
|
|
|
|