このコミットが含まれているのは:
2025-07-13 02:46:13 +09:00
コミット 0c46cf28db
29個のファイルの変更509行の追加456行の削除
+6 -7
ファイルの表示
@@ -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 ()
}