mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-22 18:00:17 +01:00
Fix pager.
This commit is contained in:
parent
aa5d81d6a1
commit
0487e48dd2
@ -45,11 +45,11 @@ export function DataTable({
|
|||||||
const noResults = Boolean(!isLoading && query && !hasData);
|
const noResults = Boolean(!isLoading && query && !hasData);
|
||||||
|
|
||||||
const handleSearch = query => {
|
const handleSearch = query => {
|
||||||
setParams({ ...params, query, page: params.query ? page : 1 });
|
setParams({ ...params, query, page: params.page ? page : 1 });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePageChange = page => {
|
const handlePageChange = page => {
|
||||||
setParams({ ...params, page });
|
setParams({ ...params, query, page });
|
||||||
};
|
};
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { useApi } from 'components/hooks/useApi';
|
import { useApi } from 'components/hooks/useApi';
|
||||||
|
import { UseQueryOptions } from '@tanstack/react-query';
|
||||||
|
|
||||||
export function useFilterQuery(key: any[], fn, options?: any) {
|
export function useFilterQuery(key: any[], fn, options?: UseQueryOptions) {
|
||||||
const [params, setParams] = useState({
|
const [params, setParams] = useState({
|
||||||
query: '',
|
query: '',
|
||||||
page: 1,
|
page: 1,
|
||||||
|
Loading…
Reference in New Issue
Block a user