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) }