diff --git a/hooks/useUserLabsData.tsx b/hooks/useUserLabsData.tsx index 3b5d009..1581796 100644 --- a/hooks/useUserLabsData.tsx +++ b/hooks/useUserLabsData.tsx @@ -17,16 +17,14 @@ const useUserLabsData = ({ email }: { email?: string | null }) => { try { const response = await getLabs({ email }) const responseData = response.data + setError(null) // update the error value to null setData(responseData) - setIsLoading({ - status: "idle", - }) } catch (error) { const errorResponse = error as ErrorResponse if (errorResponse) { setError(errorResponse) } - + } finally { setIsLoading({ status: "idle", })