Skip to content

Commit

Permalink
Fixes: Input-box-does-not-clear-on-changing-organization
Browse files Browse the repository at this point in the history
  • Loading branch information
Sulochan-khadka committed Feb 24, 2025
1 parent c269220 commit f7413f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/Organization/OrganizationView.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useQuery } from "@tanstack/react-query";
import { Link } from "raviger";
import { useState } from "react";
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";

import CareIcon from "@/CAREUI/icons/CareIcon";
Expand Down Expand Up @@ -31,6 +31,10 @@ export default function OrganizationView({ id, navOrganizationId }: Props) {
const [page, setPage] = useState(1);
const [searchQuery, setSearchQuery] = useState("");
const limit = 12; // 3x4 grid
useEffect(() => {
setSearchQuery("");
setPage(1);
}, [id]);

const { data: children, isFetching } = useQuery({
queryKey: ["organization", id, "children", page, limit, searchQuery],
Expand Down

0 comments on commit f7413f4

Please sign in to comment.