Fix Patch in Apps (#14231)

This commit is contained in:
Mohit Yadav 2023-12-05 13:06:17 +05:30 committed by GitHub
parent 3bbf55fcda
commit 91bada5796
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -499,8 +499,15 @@ public class AppResource extends EntityResource<App, AppRepository> {
@Content(
mediaType = MediaType.APPLICATION_JSON_PATCH_JSON,
examples = {@ExampleObject("[{op:remove, path:/a},{op:add, path: /b, value: val}]")}))
JsonPatch patch) {
return patchInternal(uriInfo, securityContext, id, patch);
JsonPatch patch)
throws SchedulerException {
App app = repository.get(null, id, repository.getFields("bot,pipelines"));
AppScheduler.getInstance().deleteScheduledApplication(app);
Response response = patchInternal(uriInfo, securityContext, id, patch);
if (app.getScheduleType().equals(ScheduleType.Scheduled)) {
ApplicationHandler.installApplication((App) response.getEntity(), Entity.getCollectionDAO(), searchRepository);
}
return response;
}
@PUT