Browse Source

#57 修正

#23
みてるぞ 3 weeks ago
parent
commit
01b45c1a8d
1 changed files with 8 additions and 7 deletions
  1. +8
    -7
      frontend/src/pages/posts/PostListPage.tsx

+ 8
- 7
frontend/src/pages/posts/PostListPage.tsx View File

@@ -34,13 +34,14 @@ export default () => {
})) }))


setWikiPage (null) setWikiPage (null)
if (!(tags.length))
return
void (axios.get (`${ API_BASE_URL }/wiki/title/${ encodeURIComponent (tags.join (' ')) }`)
.then (res => setWikiPage (toCamel (res.data, { deep: true })))
.catch (() => {
;
}))
if (tags.length === 1)
{
void (axios.get (`${ API_BASE_URL }/wiki/title/${ encodeURIComponent (tags[0]) }`)
.then (res => setWikiPage (toCamel (res.data, { deep: true })))
.catch (() => {
;
}))
}
}, [location.search]) }, [location.search])


return ( return (


Loading…
Cancel
Save