このコミットが含まれているのは:
@@ -8,22 +8,21 @@ import SectionTitle from '@/components/common/SectionTitle'
|
||||
import MainArea from '@/components/layout/MainArea'
|
||||
import { API_BASE_URL, SITE_TITLE } from '@/config'
|
||||
|
||||
import type { Category, WikiPage } from '@/types'
|
||||
import type { WikiPage } from '@/types'
|
||||
|
||||
|
||||
export default () => {
|
||||
const [title, setTitle] = useState ('')
|
||||
const [text, setText] = useState ('')
|
||||
const [category, setCategory] = useState<Category | null> (null)
|
||||
const [results, setResults] = useState<WikiPage[]> ([])
|
||||
|
||||
const search = () => {
|
||||
void (axios.get (`${ API_BASE_URL }/wiki/search`, { params: { title } })
|
||||
.then (res => setResults (toCamel (res.data, { deep: true }))))
|
||||
const search = async () => {
|
||||
const res = await axios.get (`${ API_BASE_URL }/wiki/search`, { params: { title } })
|
||||
setResults (toCamel (res.data as any, { deep: true }) as WikiPage[])
|
||||
}
|
||||
|
||||
const handleSearch = (e: React.FormEvent) => {
|
||||
e.preventDefault ()
|
||||
const handleSearch = (ev: React.FormEvent) => {
|
||||
ev.preventDefault ()
|
||||
search ()
|
||||
}
|
||||
|
||||
|
||||
新しい課題から参照
ユーザをブロックする