fixed some params and ui
This commit is contained in:
@@ -18,7 +18,8 @@ export const operatorKeys = {
|
||||
|
||||
export function useOperators(params: OperatorsListParams = {}) {
|
||||
const debouncedSearch = useDebouncedValue(params.search ?? "");
|
||||
const queryParams: OperatorsListParams = { ...params, search: normalizeSearch(debouncedSearch) };
|
||||
const normalized = normalizeSearch(debouncedSearch);
|
||||
const queryParams: OperatorsListParams = { ...params, search: normalized || undefined };
|
||||
|
||||
return useQuery({
|
||||
queryKey: operatorKeys.list(queryParams),
|
||||
@@ -45,7 +46,7 @@ const STAFF_PAGE_SIZE = 25;
|
||||
*/
|
||||
export function useInfiniteStaff(search = "") {
|
||||
const debouncedSearch = useDebouncedValue(search);
|
||||
const effectiveSearch = normalizeSearch(debouncedSearch);
|
||||
const effectiveSearch = normalizeSearch(debouncedSearch) || undefined;
|
||||
|
||||
return useInfiniteQuery({
|
||||
queryKey: [...operatorKeys.all, "infinite", effectiveSearch] as const,
|
||||
|
||||
Reference in New Issue
Block a user