Fix issues with basePath.

This commit is contained in:
Mike Cao committed 2020-11-09 21:01:53 -08:00
1 parent 1e8c1d0d18
commit 339cd21596
15 files changed
+66 -51

No files matched your search

+11
View 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);
}, []);
}