Skip to content

Commit

Permalink
switched to isFetching instead of isLoading
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacobjeevan committed Jan 22, 2025
1 parent 2d92913 commit bf1c9f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useGovtOrganizationLevel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function useGovtOrganizationLevel({
}
: {};

const { data: organizations, isLoading } = useQuery({
const { data: organizations, isFetching } = useQuery({
queryKey: ["organizations-level", parentId, searchQuery],
queryFn: query.debounced(organizationApi.list, {
queryParams: {
Expand Down Expand Up @@ -74,6 +74,6 @@ export function useGovtOrganizationLevel({
handleChange,
handleSearch,
organizations: organizations?.results,
isLoading,
isFetching,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function OrganizationLevelSelect({
}: OrganizationLevelProps) {
const parentId = index === 0 ? "" : previousLevel?.id || "";

const { options, handleChange, handleSearch, organizations, isLoading } =
const { options, handleChange, handleSearch, organizations, isFetching } =
useGovtOrganizationLevel({
index,
onChange: (filter: FilterState, index: number) => {
Expand Down Expand Up @@ -69,7 +69,7 @@ function OrganizationLevelSelect({
{required && <span className="text-red-500">*</span>}
</Label>
<div className="flex items-center gap-2">
{isLoading && <Loader2 className="h-6 w-6 animate-spin" />}
{isFetching && <Loader2 className="h-6 w-6 animate-spin" />}
<Autocomplete
value={currentLevel?.id || ""}
options={options}
Expand Down

0 comments on commit bf1c9f8

Please sign in to comment.