Skip to content

Commit aa8edb3

Browse files
author
Rajeev Kumar Singh
committed
Tests
1 parent 34098b7 commit aa8edb3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/com/example/webfluxdemo/controller/TweetController.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ public Mono<ResponseEntity<Tweet>> updateTweet(@PathVariable(value = "id") Strin
5252
public Mono<ResponseEntity<Void>> deleteTweet(@PathVariable(value = "id") String tweetId) {
5353

5454
return tweetRepository.findById(tweetId)
55-
.flatMap(existingTweet -> {
56-
return tweetRepository.delete(existingTweet)
57-
.then(Mono.just(new ResponseEntity<Void>(HttpStatus.OK)));
58-
})
55+
.flatMap(existingTweet ->
56+
tweetRepository.delete(existingTweet)
57+
.then(Mono.just(new ResponseEntity<Void>(HttpStatus.OK)))
58+
)
5959
.defaultIfEmpty(new ResponseEntity<>(HttpStatus.NOT_FOUND));
6060
}
6161

0 commit comments

Comments
 (0)