Skip to content

Commit

Permalink
Merge branch 'develop' into eslint_version_upgrade_v9
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaJ2305 authored Jan 22, 2025
2 parents 4ed7956 + 6eea7f5 commit 5d4f49a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 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 All @@ -68,9 +68,8 @@ function OrganizationLevelSelect({
)}
{required && <span className="text-red-500">*</span>}
</Label>
{isLoading ? (
<Loader2 className="h-6 w-6 animate-spin" />
) : (
<div className="flex items-center gap-2">
{isFetching && <Loader2 className="h-6 w-6 animate-spin" />}
<Autocomplete
value={currentLevel?.id || ""}
options={options}
Expand All @@ -82,7 +81,7 @@ function OrganizationLevelSelect({
"state"
}`}
/>
)}
</div>
</div>
);
}
Expand Down

0 comments on commit 5d4f49a

Please sign in to comment.