complete and check auth pages - error handler
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user