mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
Updated add team website form.
This commit is contained in:
parent
c990459238
commit
a14e11bae2
18 changed files with 149 additions and 129 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { useCallback, useState } from 'react';
|
||||
import { useState } from 'react';
|
||||
import { useApi } from 'components/hooks/useApi';
|
||||
|
||||
export function useFilterQuery(key: any[], fn, options?: any) {
|
||||
|
|
@ -8,19 +8,19 @@ export function useFilterQuery(key: any[], fn, options?: any) {
|
|||
});
|
||||
const { useQuery } = useApi();
|
||||
|
||||
const result = useQuery<{
|
||||
page: number;
|
||||
pageSize: number;
|
||||
count: number;
|
||||
data: any[];
|
||||
}>([...key, params], fn.bind(null, params), options);
|
||||
const { data, ...other } = useQuery([...key, params], fn.bind(null, params), options);
|
||||
|
||||
const getProps = useCallback(() => {
|
||||
const { data, isLoading, error } = result;
|
||||
return { result: data, isLoading, error, params, setParams };
|
||||
}, [result, params, setParams]);
|
||||
|
||||
return { ...result, getProps };
|
||||
return {
|
||||
result: data as {
|
||||
page: number;
|
||||
pageSize: number;
|
||||
count: number;
|
||||
data: any[];
|
||||
},
|
||||
...other,
|
||||
params,
|
||||
setParams,
|
||||
};
|
||||
}
|
||||
|
||||
export default useFilterQuery;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue