diff --git a/src/main/java/org/avniproject/etl/controller/backgroundJob/EtlJobController.java b/src/main/java/org/avniproject/etl/controller/backgroundJob/EtlJobController.java index ab34577..61cc1e5 100644 --- a/src/main/java/org/avniproject/etl/controller/backgroundJob/EtlJobController.java +++ b/src/main/java/org/avniproject/etl/controller/backgroundJob/EtlJobController.java @@ -125,14 +125,14 @@ private String getTruncatedDescription(OrganisationIdentity organisationIdentity } @PreAuthorize("hasAnyAuthority('admin')") - @DeleteMapping(value = "/job/{id}") - public String deleteJob(@PathVariable String id, @RequestParam(value="jobGroup", required = false) JobGroup jobGroup) throws SchedulerException { - boolean syncJobDeleted = scheduler.deleteJob(scheduledJobConfig.getJobKey(id, jobGroup != null ? jobGroup : JobGroup.Sync)); + @DeleteMapping(value = "/job/{entityUUID}") + public String deleteJob(@PathVariable String entityUUID, @RequestParam(value="jobGroup", required = false) JobGroup jobGroup) throws SchedulerException { + boolean syncJobDeleted = scheduler.deleteJob(scheduledJobConfig.getJobKey(entityUUID, jobGroup != null ? jobGroup : JobGroup.Sync)); String responseMsg = String.format("Sync Job Deleted: %s; ",syncJobDeleted); if (jobGroup != null && jobGroup == JobGroup.Sync) { - EtlJobSummary mediaJobRun = scheduledJobService.getLatestJobRun(id, JobGroup.MediaAnalysis); + EtlJobSummary mediaJobRun = scheduledJobService.getLatestJobRun(entityUUID, JobGroup.MediaAnalysis); if (mediaJobRun != null) { - boolean mediaAnalysisJobDeleted = scheduler.deleteJob(scheduledJobConfig.getJobKey(id, JobGroup.MediaAnalysis)); + boolean mediaAnalysisJobDeleted = scheduler.deleteJob(scheduledJobConfig.getJobKey(entityUUID, JobGroup.MediaAnalysis)); responseMsg.concat(String.format("MediaAnalysis Job Deleted: %s;", mediaAnalysisJobDeleted)); } }