mirror of
https://github.com/umami-software/umami.git
synced 2026-02-05 21:27:20 +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
|
|
@ -1,5 +1,4 @@
|
|||
import { useMutation } from '@tanstack/react-query';
|
||||
import { getClientAuthToken } from 'lib/client';
|
||||
import useApi from 'hooks/useApi';
|
||||
import { Button, Form, FormButtons, FormInput, SubmitButton, TextField } from 'react-basics';
|
||||
import styles from './Form.module.css';
|
||||
|
|
@ -7,7 +6,7 @@ import styles from './Form.module.css';
|
|||
const CONFIRM_VALUE = 'DELETE';
|
||||
|
||||
export default function UserDeleteForm({ userId, onSave, onClose }) {
|
||||
const { del } = useApi(getClientAuthToken());
|
||||
const { del } = useApi();
|
||||
const { mutate, error, isLoading } = useMutation(data => del(`/users/${userId}`, data));
|
||||
|
||||
const handleSubmit = async data => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue