bulletboards/ImageBoardServerApp/Pages/Basic/BoardPage.razor

26 lines
504 B
Text
Raw Normal View History

@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");
}
}
}