mirror of
https://github.com/outline/outline.git
synced 2026-11-27 16:08:58 +03:00
Remove test intermediate paginateFetch proxy fn
This commit is contained in:
1 parent
efc891d22a
commit
e1f6fbab7f
2 files changed
+2
-16
No files matched your search
@@ -26,7 +26,7 @@ type Props = {
|
||||
searchable?: boolean;
|
||||
paginateFetch?: (
|
||||
options: PaginatedItem
|
||||
) => Promise<TFilterOption[] | undefined>;
|
||||
) => Promise<PaginatedItem[] | undefined>;
|
||||
};
|
||||
|
||||
const FilterOptions = ({
|
||||
|
||||
@@ -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 (
|
||||
<FilterOptions
|
||||
options={options}
|
||||
@@ -58,7 +44,7 @@ function UserFilter(props: Props) {
|
||||
defaultLabel={t("Any author")}
|
||||
selectedPrefix={`${t("Author")}:`}
|
||||
searchable
|
||||
paginateFetch={paginateFetch}
|
||||
paginateFetch={users.fetchPage}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user