icynet-admin/lib/api/remote.ts

9 lines
372 B
TypeScript
Raw Normal View History

2022-08-29 18:09:28 +00:00
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);