mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 14:17:13 +01:00
Convert /api/users.
This commit is contained in:
parent
090abcff81
commit
baa3851fb4
61 changed files with 1064 additions and 70 deletions
|
|
@ -1,23 +1,16 @@
|
|||
import { useEffect } from 'react';
|
||||
import useStore, { setConfig } from 'store/app';
|
||||
import { useApi } from '../useApi';
|
||||
|
||||
let loading = false;
|
||||
import { getConfig } from 'app/actions/getConfig';
|
||||
|
||||
export function useConfig() {
|
||||
const { config } = useStore();
|
||||
const { get } = useApi();
|
||||
const configUrl = process.env.configUrl;
|
||||
|
||||
async function loadConfig() {
|
||||
const data = await get(configUrl);
|
||||
loading = false;
|
||||
setConfig(data);
|
||||
setConfig(await getConfig());
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!config && !loading && configUrl) {
|
||||
loading = true;
|
||||
if (!config) {
|
||||
loadConfig();
|
||||
}
|
||||
}, []);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export function usePagedQuery<T = any>({
|
|||
}: Omit<UseQueryOptions, 'queryFn'> & { queryFn: (params?: object) => any }): PagedQueryResult<T> {
|
||||
const { query: queryParams } = useNavigation();
|
||||
const [params, setParams] = useState<PageParams>({
|
||||
query: '',
|
||||
search: '',
|
||||
page: +queryParams.page || 1,
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue