Skip to content

Commit

Permalink
refactor: TopicController.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladik-gif committed Sep 7, 2024
1 parent 9974c26 commit a9e5e53
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ public List<ContactResponseDto> findAllSubscribersByTopicId(@PathVariable UUID t
})
@GetMapping(path = ALL_TAG, produces = APPLICATION_JSON_VALUE)
public List<TopicResponseDto> findAllByTegName(@PathVariable String tag) {
String decodedTag = URLDecoder.decode(tag, UTF_8);
return topicService.findTopicsByTagName(decodedTag);
return topicService.findTopicsByTagName(URLDecoder.decode(tag, UTF_8));
}

@Operation(summary = "Find all topics by topic name", responses = {
Expand All @@ -185,8 +184,7 @@ public List<TopicResponseDto> findAllByTegName(@PathVariable String tag) {
public List<TopicResponseDto> findAllByTopicName(
@Pattern(regexp = "^[a-zA-Z0-9а-яА-ЯІіЇї]*$", message = SEARCH_TOPIC_VALIDATION)
@RequestParam String topicName) {
String decodeTopicName = URLDecoder.decode(topicName, UTF_8);
return topicService.findTopicsByTopicName(decodeTopicName);
return topicService.findTopicsByTopicName(URLDecoder.decode(topicName, UTF_8));
}

@Operation(summary = "Add topic to favourite", responses = {
Expand Down

0 comments on commit a9e5e53

Please sign in to comment.