mirror of
https://github.com/umami-software/umami.git
synced 2026-02-14 01:25:37 +01:00
Refactored useApi usage.
This commit is contained in:
parent
561cde6e7e
commit
cad0b73e42
26 changed files with 67 additions and 85 deletions
|
|
@ -1,19 +1,19 @@
|
|||
import { useState } from 'react';
|
||||
import { Button, Icon, Modal, useToast, Flexbox } from 'react-basics';
|
||||
import { useApi } from 'next-basics';
|
||||
import useApi from 'hooks/useApi';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import EmptyPlaceholder from 'components/common/EmptyPlaceholder';
|
||||
import WebsiteAddForm from 'components/forms/WebsiteAddForm';
|
||||
import PageHeader from 'components/layout/PageHeader';
|
||||
import WebsitesTable from 'components/tables/WebsitesTable';
|
||||
import Page from 'components/layout/Page';
|
||||
import { getAuthToken } from 'lib/client';
|
||||
import { getClientAuthToken } from 'lib/client';
|
||||
import useUser from 'hooks/useUser';
|
||||
|
||||
export default function WebsitesList() {
|
||||
const [edit, setEdit] = useState(false);
|
||||
const [update, setUpdate] = useState(0);
|
||||
const { get } = useApi(getAuthToken());
|
||||
const { get } = useApi(getClientAuthToken());
|
||||
const { user } = useUser();
|
||||
const { data, isLoading, error } = useQuery(['websites', update], () =>
|
||||
get(`/users/${user.id}/websites`),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue