2023-07-11 14:28:07 +03:00

13 lines
427 B
TypeScript

import { love } from './tools';
import type { User } from './types';
import getUrls from '@/config/urls';
import { withHandleError } from '@/utils/axios';
import type { AxiosRequestConfig } from 'axios';
import axios from 'axios';
const { URL_GET_USER } = getUrls();
export async function getUser(config?: AxiosRequestConfig) {
return withHandleError(axios.get<User>(URL_GET_USER, config).then((res) => love(res.data)));
}