mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
Fix issues with basePath.
This commit is contained in:
parent
1e8c1d0d18
commit
339cd21596
15 changed files with 66 additions and 51 deletions
11
hooks/usePost.js
Normal file
11
hooks/usePost.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { useCallback } from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import { post } from 'lib/web';
|
||||
|
||||
export default function usePost() {
|
||||
const { basePath } = useRouter();
|
||||
|
||||
return useCallback(async (url, params, headers) => {
|
||||
return post(`${basePath}${url}`, params, headers);
|
||||
}, []);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue