9 lines
372 B
TypeScript
9 lines
372 B
TypeScript
|
import { API_URL } from '../constants';
|
||
|
import { CurrentUserDto } from '../types/user-response.interface';
|
||
|
import { fetchBearer, fetchToken } from '../utils/fetch';
|
||
|
|
||
|
export const getUserInfo = async (accessToken: string) =>
|
||
|
await fetchBearer<CurrentUserDto>(accessToken, `${API_URL}/user`);
|
||
|
|
||
|
export const getAccessToken = async (code: string) => await fetchToken(code);
|