From b58c114b15169e968413dd84064aedcdfacd57e0 Mon Sep 17 00:00:00 2001 From: miteruzo Date: Thu, 29 Jan 2026 07:29:13 +0900 Subject: [PATCH] =?UTF-8?q?#28=20=E4=BB=B6=E6=95=B0=200=20=E4=BB=B6?= =?UTF-8?q?=E9=99=A4=E5=A4=96=E3=82=92=E3=81=A4=E3=81=84=E3=81=A7=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=EF=BC=88=E3=83=95=E3=83=AD=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=81=AE=E3=81=BF=EF=BC=9B=E3=83=90=E3=83=83=E3=82=AF=E3=82=A8?= =?UTF-8?q?=E3=83=B3=E3=83=89=E3=81=AF=E5=BE=8C=E3=81=A7=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/PostFormTagsArea.tsx | 3 ++- frontend/src/components/TagSearch.tsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/PostFormTagsArea.tsx b/frontend/src/components/PostFormTagsArea.tsx index 38ffd70..de97ada 100644 --- a/frontend/src/components/PostFormTagsArea.tsx +++ b/frontend/src/components/PostFormTagsArea.tsx @@ -60,7 +60,8 @@ export default (({ tags, setTags }: Props) => { const { start, end, token } = getTokenAt (v, pos) setBounds ({ start, end }) const res = await axios.get (`${ API_BASE_URL }/tags/autocomplete`, { params: { q: token } }) - setSuggestions (toCamel (res.data as any, { deep: true }) as Tag[]) + const data = toCamel (res.data as any, { deep: true }) as Tag[] + setSuggestions (data.filter (t => t.postCount > 0)) setSuggestionsVsbl (suggestions.length > 0) } diff --git a/frontend/src/components/TagSearch.tsx b/frontend/src/components/TagSearch.tsx index 62cb8d2..de1cde1 100644 --- a/frontend/src/components/TagSearch.tsx +++ b/frontend/src/components/TagSearch.tsx @@ -33,7 +33,7 @@ export default (() => { const res = await axios.get (`${ API_BASE_URL }/tags/autocomplete`, { params: { q } }) const data = toCamel (res.data, { deep: true }) as Tag[] - setSuggestions (data) + setSuggestions (data.filter (t => t.postCount > 0)) if (suggestions.length > 0) setSuggestionsVsbl (true) }