mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 07:07:17 +01:00
Refactored useApi usage.
This commit is contained in:
parent
561cde6e7e
commit
cad0b73e42
26 changed files with 67 additions and 85 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { useMutation } from '@tanstack/react-query';
|
||||
import { getAuthToken } from 'lib/client';
|
||||
import { getClientAuthToken } from 'lib/client';
|
||||
import { getRandomChars, useApi } from 'next-basics';
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import {
|
||||
|
|
@ -16,7 +16,7 @@ import {
|
|||
export default function ShareUrlForm({ websiteId, data, onSave }) {
|
||||
const { name, shareId } = data;
|
||||
const [id, setId] = useState(shareId);
|
||||
const { post } = useApi(getAuthToken());
|
||||
const { post } = useApi(getClientAuthToken());
|
||||
const { mutate, error } = useMutation(({ shareId }) =>
|
||||
post(`/websites/${websiteId}`, { shareId }),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue