connected visa intl payments
This commit is contained in:
@@ -59,7 +59,7 @@ export function UserForm({ mode, initialData }: UserFormProps) {
|
||||
|
||||
const roleSelect: Omit<InfiniteSelectProps, "label" | "required" | "placeholder"> = useMemo(() => {
|
||||
const opts: InfiniteSelectOption[] = (roleQuery.data?.pages ?? [])
|
||||
.flatMap((p) => p.roles)
|
||||
.flatMap((p) => p?.roles ?? [])
|
||||
.map((r) => ({ value: r.code, label: r.name }));
|
||||
|
||||
// Ensure the currently-selected role is present (edit mode), even if it
|
||||
|
||||
@@ -35,8 +35,9 @@ export function useInfiniteUsers(search = "") {
|
||||
initialPageParam: 1,
|
||||
queryFn: ({ pageParam, signal }) => usersApi.getUsers({ page: pageParam, limit: USER_PAGE_SIZE, search: effectiveSearch }, signal),
|
||||
getNextPageParam: (lastPage, allPages) => {
|
||||
const loaded = allPages.reduce((sum, p) => sum + p.users.length, 0);
|
||||
return loaded < lastPage.count ? allPages.length + 1 : undefined;
|
||||
const loaded = allPages.reduce((sum, p) => sum + (p?.users?.length ?? 0), 0);
|
||||
const count = lastPage?.count ?? 0;
|
||||
return loaded < count ? allPages.length + 1 : undefined;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user