Improve types
This commit is contained in:
parent
06d1ad2efe
commit
4d98046627
1 changed files with 3 additions and 3 deletions
|
@ -11,7 +11,7 @@ export default function useTrends() {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
|
||||||
const getTrends = async() => {
|
const getTrends = async() => {
|
||||||
const { data } = await api.get<Tag[]>('/api/v1/trends');
|
const { data } = await api.get<any[]>('/api/v1/trends');
|
||||||
|
|
||||||
dispatch(fetchTrendsSuccess(data));
|
dispatch(fetchTrendsSuccess(data));
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ export default function useTrends() {
|
||||||
return normalizedData;
|
return normalizedData;
|
||||||
};
|
};
|
||||||
|
|
||||||
const result = useQuery<Tag[]>(['trends'], getTrends, {
|
const result = useQuery<ReadonlyArray<Tag>>(['trends'], getTrends, {
|
||||||
placeholderData: [],
|
placeholderData: [],
|
||||||
staleTime: 600000, // 10 minutes
|
staleTime: 600000, // 10 minutes
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue