mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +01:00
Refactor: removed default exports.
This commit is contained in:
parent
cd944e14ce
commit
f83a12d6cd
343 changed files with 555 additions and 1046 deletions
|
|
@ -3,7 +3,7 @@ import * as reactQuery from '@tanstack/react-query';
|
|||
import { getClientAuthToken } from '@/lib/client';
|
||||
import { SHARE_TOKEN_HEADER } from '@/lib/constants';
|
||||
import { httpGet, httpPost, httpPut, httpDelete, FetchResponse } from '@/lib/fetch';
|
||||
import useStore from '@/store/app';
|
||||
import { useApp } from '@/store/app';
|
||||
|
||||
const selector = (state: { shareToken: { token?: string } }) => state.shareToken;
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ function handleError(err: Error | string) {
|
|||
}
|
||||
|
||||
export function useApi() {
|
||||
const shareToken = useStore(selector);
|
||||
const shareToken = useApp(selector);
|
||||
|
||||
const defaultHeaders = {
|
||||
authorization: `Bearer ${getClientAuthToken()}`,
|
||||
|
|
@ -74,5 +74,3 @@ export function useApi() {
|
|||
...reactQuery,
|
||||
};
|
||||
}
|
||||
|
||||
export default useApi;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue