- 게시판 목록 화면의 태그 필터가 전체 태그를 보여주던 문제(매핑 무시) 수정 - 글쓰기와 동일한 listWritableGroups 기준으로 일관 적용 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -120,9 +120,17 @@ public class BoardController {
|
|||||||
return ResponseEntity.noContent().build();
|
return ResponseEntity.noContent().build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 목록 태그 필터 — 게시판 지정 시 그 게시판에 매핑된 그룹의 태그만 */
|
||||||
@GetMapping("/tags")
|
@GetMapping("/tags")
|
||||||
public List<String> tags() {
|
public List<String> tags(@RequestParam(required = false) String category) {
|
||||||
return boardService.allTags();
|
if (category == null || category.isBlank()) {
|
||||||
|
return boardService.allTags();
|
||||||
|
}
|
||||||
|
return tagService.listWritableGroups(category).stream()
|
||||||
|
.flatMap(g -> g.getTags().stream())
|
||||||
|
.map(com.sb.web.board.dto.TagResponse::getName)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 글 작성 시 선택 가능한 태그 (해당 게시판에 매핑된 그룹만) */
|
/** 글 작성 시 선택 가능한 태그 (해당 게시판에 매핑된 그룹만) */
|
||||||
|
|||||||
Reference in New Issue
Block a user