fix: remove URL desyncs when trying to search users table (#11144)

* fix: remove URL search params desync

* refactor: clean up payload definition for clarity
This commit is contained in:
Michael Smith
2023-12-12 00:45:03 +00:00
committed by GitHub
parent ba3b835339
commit 3ce7b2ebe6
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -17,12 +17,12 @@ export function usersKey(req: UsersRequest) {
return ["users", req] as const;
}
export function paginatedUsers(): UsePaginatedQueryOptions<
GetUsersResponse,
UsersRequest
> {
export function paginatedUsers(
searchParams: URLSearchParams,
): UsePaginatedQueryOptions<GetUsersResponse, UsersRequest> {
return {
queryPayload: ({ limit, offset, searchParams }) => {
searchParams,
queryPayload: ({ limit, offset }) => {
return {
limit,
offset,
+1 -1
View File
@@ -55,7 +55,7 @@ export const UsersPage: FC<{ children?: ReactNode }> = () => {
enabled: viewDeploymentValues,
});
const usersQuery = usePaginatedQuery(paginatedUsers());
const usersQuery = usePaginatedQuery(paginatedUsers(searchParamsResult[0]));
const useFilterResult = useFilter({
searchParamsResult,
onUpdate: usersQuery.goToFirstPage,