14 lines
394 B
TypeScript

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