29 lines
671 B
Plaintext
29 lines
671 B
Plaintext
@page "/jobs/{jobId:int}/edit"
|
|
@using ECM.JobRunner.Common.JobRunnerReference;
|
|
@using ECM.JobRunner.Web.Data;
|
|
@using ECM.JobRunner.Web.Components.Job;
|
|
@inject NavigationManager Navigation;
|
|
@inject JobService Jobs;
|
|
|
|
<PageTitle>Job bearbeiten</PageTitle>
|
|
|
|
<h3>Job bearbeiten</h3>
|
|
|
|
<JobForm JobId="JobId" OnValidSubmit="OnFormSubmit" />
|
|
|
|
@code {
|
|
[Parameter]
|
|
public int JobId { get; set; }
|
|
|
|
private async void OnFormSubmit(EditContext ctx)
|
|
{
|
|
JobDefinition job = (JobDefinition)ctx.Model;
|
|
bool result = await Jobs.UpdateJob(job);
|
|
|
|
if (result == true)
|
|
{
|
|
Navigation.NavigateTo($"/jobs/{job.Id}");
|
|
}
|
|
}
|
|
}
|