working on edit form

This commit is contained in:
2026-03-22 21:01:54 +01:00
parent 7594d179a8
commit 65fa420306
9 changed files with 174 additions and 6 deletions
@@ -0,0 +1,38 @@
using CityInfo.WEB.Models;
using CityInfo.WEB.Services;
using Microsoft.AspNetCore.Components;
namespace CityInfo.WEB.Pages
{
public partial class PointOfInterestEdit
{
[Inject]
public IPointOfInterestDataService PointOfInterestDataService { get; set; } = default!;
[Inject]
public ICityDataService CityDataService { get; set; } = default!;
[Inject]
public NavigationManager NavigationManager { get; set; } = default!;
[Parameter]
public int CityId { get; set; }
[Parameter]
public int PointOfInterestId { get; set; }
public PointOfInterest? PointOfInterest { get; set; }
protected async override Task OnInitializedAsync()
{
PointOfInterest = await PointOfInterestDataService.GetPointOfInterest(CityId, PointOfInterestId);
if (PointOfInterest == null)
{
NavigationManager.NavigateTo("not-found");
return;
}
}
private async Task HandleValidSubmit()
{
}
private async Task HandleInvalidSubmit()
{
}
}
}