* Fixed Hangfire update jobs
This commit is contained in:
@@ -92,6 +92,17 @@
|
||||
await LoadTasks();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task UpdateTask(TaskSchedulerDto taskSchedulerDto)
|
||||
{
|
||||
var response = await HangfireService.UpdateTaskSchedulerAsync(taskSchedulerDto);
|
||||
if (response == 1)
|
||||
{
|
||||
await LoadTasks();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private async Task LoadTasks()
|
||||
{
|
||||
@@ -108,6 +119,9 @@
|
||||
case Action.Save when args.Data.Id == 0:
|
||||
await AddTask(args.Data);
|
||||
break;
|
||||
case Action.Save when args.Data.Id != 0:
|
||||
await UpdateTask(args.Data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,4 +28,10 @@ public class HangfireService(
|
||||
HttpResponseMessage responseMessage = await PostAsJsonAsync("api/HangfireJobs/delete", taskSchedulerDto);
|
||||
return responseMessage.IsSuccessStatusCode ? 1 : 0;
|
||||
}
|
||||
|
||||
public async Task<int> UpdateTaskSchedulerAsync(TaskSchedulerDto taskSchedulerDto)
|
||||
{
|
||||
HttpResponseMessage responseMessage = await PostAsJsonAsync("api/HangfireJobs/update", taskSchedulerDto);
|
||||
return responseMessage.IsSuccessStatusCode ? 1 : 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user