From e1f6fbab7ffa62a6edcce079c0f4cf7dd20bee53 Mon Sep 17 00:00:00 2001 From: CuriousCorrelation Date: Wed, 13 Jul 2022 16:07:20 +0530 Subject: [PATCH] Remove test intermediate `paginateFetch` proxy fn --- app/components/FilterOptions.tsx | 2 +- app/scenes/Search/components/UserFilter.tsx | 16 +--------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/app/components/FilterOptions.tsx b/app/components/FilterOptions.tsx index 154c9f1ea3..cbab7c979e 100644 --- a/app/components/FilterOptions.tsx +++ b/app/components/FilterOptions.tsx @@ -26,7 +26,7 @@ type Props = { searchable?: boolean; paginateFetch?: ( options: PaginatedItem - ) => Promise; + ) => Promise; }; const FilterOptions = ({ diff --git a/app/scenes/Search/components/UserFilter.tsx b/app/scenes/Search/components/UserFilter.tsx index 3ffd11f442..261076e26e 100644 --- a/app/scenes/Search/components/UserFilter.tsx +++ b/app/scenes/Search/components/UserFilter.tsx @@ -1,9 +1,7 @@ import { observer } from "mobx-react"; import * as React from "react"; import { useTranslation } from "react-i18next"; -import User from "~/models/User"; import FilterOptions from "~/components/FilterOptions"; -import { PaginatedItem } from "~/components/PaginatedList"; import useStores from "~/hooks/useStores"; type Props = { @@ -38,18 +36,6 @@ function UserFilter(props: Props) { ]; }, [users.all, t]); - const paginateFetch = React.useCallback( - async (options: PaginatedItem) => { - const list = await users.fetchPage(options); - return list.map((user: User) => ({ - key: user.id, - id: user.id, - label: user.name, - })); - }, - [users] - ); - return ( ); }