complete and check auth pages - error handler

This commit is contained in:
Alihaghighattalab
2024-08-26 17:59:20 +03:30
parent 5ec6ffdacc
commit 10a6a746ed
20 changed files with 137 additions and 56 deletions
+7 -1
View File
@@ -3,13 +3,19 @@ import { AwardNotComplete } from "./award-not-complete"
import { getAwardsList } from "../../services/api/awards"
import { AwardsResponse } from "../../types"
import { AwardSkeleton } from "./award-skeleton"
import { handleError } from "../../utility/error-handle"
import { useEffect } from "react"
export const Awards = () => {
const { data, isLoading } = useQuery({
const { data, isLoading, error } = useQuery({
queryKey: ["awards"],
queryFn: getAwardsList
})
useEffect(() => {
handleError(error)
}, [error])
if (isLoading) return <AwardSkeleton />
return (
<div className="flex flex-col gap-10">