@page "/admin/system/customisation/themes/{id:int}" @using Moonlight.Client.Services @using Moonlight.Shared.Http.Requests.Admin.Sys.Theme @using Moonlight.Shared.Http.Responses.Admin @using Moonlight.Client.UI.Components @inject ThemeService ThemeService @inject ToastService ToastService @inject NavigationManager Navigation Back Update
@code { [Parameter] public int Id { get; set; } private ThemeResponse Response; private UpdateThemeRequest Request; private HandleForm Form; private async Task Load(LazyLoader _) { Response = await ThemeService.Get(Id); Request = new() { Content = Response.Content, Author = Response.Author, Name = Response.Name, Version = Response.Version, DonateUrl = Response.DonateUrl, IsEnabled = Response.IsEnabled, UpdateUrl = Response.UpdateUrl }; } private async Task OnValidSubmit() { await ThemeService.Update(Id, Request); await ToastService.Success("Successfully updated theme"); Navigation.NavigateTo("/admin/system/customisation"); } }