Skip to content

Commit

Permalink
fix reverse reflection not happening properly
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Oct 16, 2024
1 parent e46f39f commit 30000ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/CAREUI/misc/PaginatedList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function useContextualized<TItem>() {
interface Props<TItem> extends QueryOptions<PaginatedResponse<TItem>> {
route: QueryRoute<PaginatedResponse<TItem>>;
perPage?: number;
initialPage?: number;
onPageChange?: (page: number) => void;
queryCB?: (
query: ReturnType<typeof useQuery<PaginatedResponse<TItem>>>,
Expand All @@ -50,7 +51,7 @@ export default function PaginatedList<TItem extends object>({
queryCB,
...queryOptions
}: Props<TItem>) {
const [currentPage, _setPage] = useState(1);
const [currentPage, _setPage] = useState(queryOptions.initialPage ?? 1);

const setPage = (page: number) => {
_setPage(page);
Expand Down
1 change: 1 addition & 0 deletions src/Components/Facility/DischargedPatientsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ const DischargedPatientsList = ({
pathParams={{ facility_external_id }}
query={{ ordering: "-modified_date", ...qParams }}
queryCB={(query) => setCount(query.data?.count || 0)}
initialPage={qParams.page}
onPageChange={updatePage}
>
{() => (
Expand Down

0 comments on commit 30000ad

Please sign in to comment.