@page "/session/edit/{SessionId:guid}"
@using GmRelay.Web.Services
@using GmRelay.Shared.Domain
@using Microsoft.AspNetCore.Authorization
@attribute [Authorize]
@inject SessionService SessionService
@inject NavigationManager Navigation
Редактирование сессии — GM-Relay
@if (session == null)
{
}
else
{
@if (!string.IsNullOrEmpty(errorMessage))
{
⚠️ @errorMessage
}
}
@code {
[Parameter] public Guid SessionId { get; set; }
private WebSession? session;
private SessionEditModel model = new();
private bool isSubmitting = false;
private string? errorMessage;
protected override async Task OnInitializedAsync()
{
session = await SessionService.GetSessionAsync(SessionId);
if (session != null)
{
model.Title = session.Title;
// Convert UTC to Moscow for the picker
model.ScheduledAtLocal = session.ScheduledAt.ToMoscow();
model.JoinLink = session.JoinLink;
}
}
private async Task HandleSubmit()
{
isSubmitting = true;
errorMessage = null;
try
{
// The value from