From 040d3b0cc4e4e2316ba748846b4dd2e1fbecd886 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Fri, 18 Jun 2021 13:27:31 +0530 Subject: [PATCH] Fix publish application event not being sent --- .../server/controllers/ApplicationController.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ApplicationController.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ApplicationController.java index 2dccd3966b..f1d0706871 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ApplicationController.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ApplicationController.java @@ -78,13 +78,13 @@ public class ApplicationController extends BaseController> publish(@PathVariable String applicationId) { return applicationPageService.publish(applicationId) - .map(application -> { - // This event should parallel a similar event sent from the client, so we want it to be sent by the - // controller and not the service method. - applicationPageService.sendApplicationPublishedEvent(application); - // This will only be called when the publishing was successful, so we can always return `true` here. - return new ResponseDTO<>(HttpStatus.OK.value(), true, null); - }); + .flatMap(application -> + // This event should parallel a similar event sent from the client, so we want it to be sent by the + // controller and not the service method. + applicationPageService.sendApplicationPublishedEvent(application) + // This will only be called when the publishing was successful, so we can always return `true` here. + .thenReturn(new ResponseDTO<>(HttpStatus.OK.value(), true, null)) + ); } @PutMapping("/{applicationId}/page/{pageId}/makeDefault")