Fix issues with basePath.
This commit is contained in:
1 parent
1e8c1d0d18
commit
339cd21596
15 files changed
+66
-51
No files matched your search
@@ -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);
|
||||
}, []);
|
||||
}
|
||||
Reference in new issue
Block a user