Skip to content

Commit

Permalink
Update Carlist.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
juhahinkula authored Mar 18, 2024
1 parent 7f5dab0 commit a2cea69
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Chapter15/src/components/Carlist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ function Carlist() {

const queryClient = useQueryClient();

const { data, isError, isLoading } = useQuery({
queryKey: ["cars"],
const { data, isError, isLoading, isSuccess } = useQuery({
queryKey: ["cars"],
queryFn: getCars
});

Expand Down Expand Up @@ -72,7 +72,7 @@ function Carlist() {
else if (isError) {
return <span>Error when fetching cars...</span>
}
else {
else if (isSuccess) {
return (
<>
<AddCar />
Expand Down

0 comments on commit a2cea69

Please sign in to comment.