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}")
|
@PostMapping("/publish/{applicationId}")
|
||||||
public Mono<ResponseDTO<Boolean>> publish(@PathVariable String applicationId) {
|
public Mono<ResponseDTO<Boolean>> publish(@PathVariable String applicationId) {
|
||||||
return applicationPageService.publish(applicationId)
|
return applicationPageService.publish(applicationId)
|
||||||
.map(application -> {
|
.flatMap(application ->
|
||||||
// This event should parallel a similar event sent from the client, so we want it to be sent by the
|
// 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.
|
// controller and not the service method.
|
||||||
applicationPageService.sendApplicationPublishedEvent(application);
|
applicationPageService.sendApplicationPublishedEvent(application)
|
||||||
// This will only be called when the publishing was successful, so we can always return `true` here.
|
// 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);
|
.thenReturn(new ResponseDTO<>(HttpStatus.OK.value(), true, null))
|
||||||
});
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/{applicationId}/page/{pageId}/makeDefault")
|
@PutMapping("/{applicationId}/page/{pageId}/makeDefault")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user