Fix publish application event not being sent
This commit is contained in:
parent
91bf527bea
commit
040d3b0cc4
|
|
@ -78,13 +78,13 @@ public class ApplicationController extends BaseController<ApplicationService, Ap
|
|||
@PostMapping("/publish/{applicationId}")
|
||||
public Mono<ResponseDTO<Boolean>> 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")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user