const { data, refetch, isRefetching } = useQuery({
queryKey: ["normal_fetch"],
queryFn: async () => {
const { data } = await axios.get("/api/votes/fetchVote");
return data as VoteProps[];
},
onError: (err) => {
if (err instanceof AxiosError) {
if (err.response?.status === 401) {
return console.log("errror");
}
}
},
});
const { data, refetch, isRefetching } = useQuery({
queryKey: ["normal_fetch"],
queryFn: async () => {
const { data } = await axios.get("/api/votes/fetchVote");
return data as VoteProps[];
},
onError: (err) => {
if (err instanceof AxiosError) {
if (err.response?.status === 401) {
return console.log("errror");
}
}
},
});