Added teams pages. Refactored hooks.

This commit is contained in:
Mike Cao 2024-01-28 18:33:40 -08:00
parent a2c202fa36
commit 9448aa3ab5
136 changed files with 387 additions and 287 deletions

View file

@ -1,20 +0,0 @@
import * as reactQuery from '@tanstack/react-query';
import { useApi as nextUseApi } from 'next-basics';
import { getClientAuthToken } from 'lib/client';
import { SHARE_TOKEN_HEADER } from 'lib/constants';
import useStore from 'store/app';
const selector = state => state.shareToken;
export function useApi() {
const shareToken = useStore(selector);
const { get, post, put, del } = nextUseApi(
{ authorization: `Bearer ${getClientAuthToken()}`, [SHARE_TOKEN_HEADER]: shareToken?.token },
process.env.basePath,
);
return { get, post, put, del, ...reactQuery };
}
export default useApi;