[fix] fix loading status

This commit is contained in:
但为君故
2024-09-28 00:42:25 +08:00
committed by GitHub
parent 899cd9c517
commit 6d15618747

View File

@@ -24,6 +24,7 @@ export default function SearchPage(props: SearchPageProps) {
const { toast } = useToast(); const { toast } = useToast();
const fetchSearchAPI = (param: string): Promise<TSearchResultItem[]> => { const fetchSearchAPI = (param: string): Promise<TSearchResultItem[]> => {
setIsLoading(true)
return axios.get<TSearchResultItem[]>(`/api/search/${param}`).then((response) => response.data); return axios.get<TSearchResultItem[]>(`/api/search/${param}`).then((response) => response.data);
}; };