bulletboards/ImageBoardServerApp/Pages/Basic/BoardPage.razor
2023-06-08 23:33:54 +02:00

26 lines
No EOL
504 B
Text

@page "/{boardTag}/"
@using System.ComponentModel.DataAnnotations
@using ImageBoardServerApp.Data.Repository
@inject NavigationManager navManager
<Board board="@m"/>
@code {
[Parameter]
[Required]
public string boardTag { get; set; }
private BoardData m;
protected override async Task OnParametersSetAsync()
{
m = await BoardsRepository.getBoardByTagAsync(boardTag);
if (m == null)
{
navManager.NavigateTo("/sys/dead");
}
}
}