Chika 7bbde70631 project: rename services -> api
api/user: get domainName from auth service
2022-08-31 16:18:10 +03:00

14 lines
404 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 getUser(config: AxiosRequestConfig) {
const user = await axios
.get<User>(process.env.NEXT_PUBLIC_URL_GET_USER || '', config)
.then((res) => love(res.data));
return user;
}