mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 18:26:20 +01:00
13 lines
398 B
JavaScript
13 lines
398 B
JavaScript
import { useApi as nextUseApi } from 'next-basics';
|
|
import { getClientAuthToken } from 'lib/client';
|
|
import { useRouter } from 'next/router';
|
|
import * as reactQuery from '@tanstack/react-query';
|
|
|
|
export default function useApi() {
|
|
const { basePath } = useRouter();
|
|
|
|
const { get, post, put, del } = nextUseApi(getClientAuthToken(), basePath);
|
|
|
|
return { get, post, put, del, ...reactQuery };
|
|
}
|