2023-01-11 11:26:08 +03:00

15 lines
436 B
TypeScript

/* eslint-disable import/prefer-default-export */
import type { AxiosRequestConfig } from 'axios';
import axios from 'axios';
import getUrls from 'config/urls';
import { love } from './tools';
import type { User } from './types';
const { URL_GET_USER } = getUrls();
export async function getUser(config: AxiosRequestConfig) {
const user = await axios.get<User>(URL_GET_USER, config).then((res) => love(res.data));
return user;
}