@page "/citizen/profile" @using JobsJobsJobs.Client.ViewModels @inject HttpClient http @inject AppState state

Employment Profile

@if (errorMessage != "") {

@errorMessage

} else if (profileForm != null) {
@foreach (var (id, name) in continents) { }
} @code { public JobsJobsJobs.Shared.Profile? profile = null; public ProfileForm? profileForm = null; private IEnumerable continents = Enumerable.Empty(); public string errorMessage = ""; protected override async Task OnInitializedAsync() { var continentResult = await ServerApi.AllContinents(http, state); if (continentResult.IsOk) { continents = continentResult.Ok; } else { errorMessage = continentResult.Error; } var result = await ServerApi.RetrieveProfile(http, state); if (result.IsOk) { profile = result.Ok; profileForm = (profile == null) ? new ProfileForm() : ProfileForm.FromProfile(profile); } else { errorMessage = result.Error; } } public void SaveProfile() { // TODO: save profile } }