Skip to content

Commit 9160dcc

Browse files
committed
[Refactor]: 작성자 검색 시에만 익명 유저가 안나타나게 수정
1 parent c67889b commit 9160dcc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

back/src/main/java/com/back/domain/post/repository/PostRepositoryCustomImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private BooleanExpression getSearchCondition(String searchKeyword, SearchType se
7575
}
7676

7777
private BooleanExpression excludeHiddenIfSearch(String searchKeyword, SearchType searchType) {
78-
if (!StringUtils.hasText(searchKeyword) || searchType == null) {
78+
if (!StringUtils.hasText(searchKeyword) || searchType != SearchType.AUTHOR) {
7979
return null;
8080
}
8181
return post.hide.eq(false);

back/src/test/java/com/back/domain/post/controller/PostControllerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ void successWithTitleContentSearch() throws Exception {
277277
.param("searchType", "TITLE_CONTENT")
278278
.param("keyword", "게시글"))
279279
.andExpect(status().isOk())
280-
.andExpect(jsonPath("$.items.length()").value(3));
280+
.andExpect(jsonPath("$.items.length()").value(5));
281281
}
282282

283283
@Test

0 commit comments

Comments
 (0)