feat : ajouter question
continuous-integration/drone/push Build is passing Details

Multiplayer_Php
Maxence GUITARD 1 year ago
parent ca51465a17
commit d7e2040aa9

@ -23,6 +23,9 @@ namespace Blazor.Pages.Questions
[Inject] [Inject]
public required NavigationManager NavigationManager { get; set; } public required NavigationManager NavigationManager { get; set; }
[Inject]
public HttpClient Http { get; set; }
[Inject] [Inject]
public ILogger<AddAdministrator> Logger { get; set; } public ILogger<AddAdministrator> Logger { get; set; }
public class Checkbox public class Checkbox
@ -46,7 +49,7 @@ namespace Blazor.Pages.Questions
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
{ {
var response = Http.GetFromJsonAsync<Chapter[]>($"https://trusting-panini.87-106-126-109.plesk.page/api/chapters/qUOGkWdoPCgbmuqxIC8xiaX0rV1Pw1LoPafkaoHOgszEyD9P2vcOu493xCDZpAqO").Result; var response = Http.GetFromJsonAsync<Chapter[]>(API.API_URL + "chapters/" + API.TOKEN).Result;
chapters = new List<Chapter>(response); chapters = new List<Chapter>(response);
} }

@ -6,4 +6,10 @@ public class Answer
public string? Content { get; set; } public string? Content { get; set; }
public int IdQuestion { get; set; } public int IdQuestion { get; set; }
public Answer(int id, string content, int idQuestion)
{
Id = id;
Content = content;
IdQuestion = idQuestion;
}
} }

Loading…
Cancel
Save