[fix] fix loading status
This commit is contained in:
@@ -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);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user