This repository has been archived on 2024-06-14. You can view files and clone it, but cannot push or open issues or pull requests.
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);