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
2022-08-29 21:09:28 +03:00

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);