- boardApi.tags(category), 게시판 변경 시 태그 필터 재로드 - 매핑된 그룹의 태그만 필터 칩으로 노출 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -35,8 +35,8 @@ export const boardApi = {
|
||||
timeout: 30000,
|
||||
})
|
||||
},
|
||||
tags() {
|
||||
return http.get('/board/tags')
|
||||
tags(category) {
|
||||
return http.get('/board/tags', { params: { category: category || undefined } })
|
||||
},
|
||||
tagGroups(category) {
|
||||
return http.get('/board/tag-groups', { params: { category: category || undefined } })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { boardApi } from '@/api/boardApi'
|
||||
import { formatRelative } from '@/utils/datetime'
|
||||
@@ -71,7 +71,7 @@ async function load() {
|
||||
|
||||
async function loadTags() {
|
||||
try {
|
||||
tags.value = await boardApi.tags()
|
||||
tags.value = await boardApi.tags(category.value)
|
||||
} catch {
|
||||
tags.value = []
|
||||
}
|
||||
@@ -132,7 +132,8 @@ watch(
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
onMounted(loadTags)
|
||||
// 게시판이 바뀌면 태그 필터도 그 게시판 기준으로 다시 로드
|
||||
watch(category, loadTags, { immediate: true })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user