mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user