We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34098b7 commit aa8edb3Copy full SHA for aa8edb3
src/main/java/com/example/webfluxdemo/controller/TweetController.java
@@ -52,10 +52,10 @@ public Mono<ResponseEntity<Tweet>> updateTweet(@PathVariable(value = "id") Strin
52
public Mono<ResponseEntity<Void>> deleteTweet(@PathVariable(value = "id") String tweetId) {
53
54
return tweetRepository.findById(tweetId)
55
- .flatMap(existingTweet -> {
56
- return tweetRepository.delete(existingTweet)
57
- .then(Mono.just(new ResponseEntity<Void>(HttpStatus.OK)));
58
- })
+ .flatMap(existingTweet ->
+ tweetRepository.delete(existingTweet)
+ .then(Mono.just(new ResponseEntity<Void>(HttpStatus.OK)))
+ )
59
.defaultIfEmpty(new ResponseEntity<>(HttpStatus.NOT_FOUND));
60
}
61
0 commit comments