@page "/site-info/{SiteId:int}" @attribute [Authorize] @using BLAIzor.Components.Layout @using BLAIzor.Models @using BLAIzor.Services @using Microsoft.AspNetCore.Components.Authorization @layout AdminLayout @inject ScopedContentService SiteInfoService @inject AuthenticationStateProvider AuthenticationStateProvider @inject CustomAuthenticationStateProvider CustomAuthProvider

Site Information


Forms linked to this site

@if (siteInfo.FormDefinitions?.Count > 0) { } else {

No forms added yet.

} Add New Form @code { [Parameter] public int SiteId { get; set; } private SiteInfo siteInfo = new(); private string? userId; private string? userName; private AuthenticationState? authState; protected override async Task OnParametersSetAsync() { authState = await AuthenticationStateProvider.GetAuthenticationStateAsync(); if (authState.User.Identity?.IsAuthenticated == true) { userId = CustomAuthProvider.GetUserId(); userName = CustomAuthProvider.GetUserName(); } siteInfo = await SiteInfoService.GetSiteInfoWithFormsByIdAsync(SiteId) ?? new SiteInfo(); } private async Task SaveSiteInfo() { await SiteInfoService.UpdateSiteInfoAsync(siteInfo); } }