mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Refactored fetching to use react-query.
This commit is contained in:
parent
7bbed0e12b
commit
c56f02c475
112 changed files with 255 additions and 492 deletions
|
|
@ -3,7 +3,6 @@ import PageHeader from 'components/layout/PageHeader';
|
|||
import UsersTable from 'components/tables/UsersTable';
|
||||
import { useState } from 'react';
|
||||
import { Button, Icon, useToast } from 'react-basics';
|
||||
import { getClientAuthToken } from 'lib/client';
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
import useApi from 'hooks/useApi';
|
||||
|
||||
|
|
@ -11,7 +10,7 @@ export default function UsersList() {
|
|||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState();
|
||||
const { toast, showToast } = useToast();
|
||||
const { post } = useApi(getClientAuthToken());
|
||||
const { post } = useApi();
|
||||
const { mutate, isLoading } = useMutation(data => post('/api-key', data));
|
||||
|
||||
const handleSave = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue