import { API_URL } from '../../config' import { UserResponse, User } from './types' import { faker } from '@faker-js/faker/locale/ru' const initialUser: User = import.meta.env.DEV ? { // Temporary, until api is realized id: Math.random() * 100, name: faker.person.firstName() + ' ' + faker.person.lastName(), regDate: faker.date.anytime().getTime(), points: Math.round(Math.random() * 1000), } : { id: 1, name: 'Вася пупкин', regDate: 0, points: 100, } const composeUserURL = () => ( API_URL + '/users/me?' ) const processUser = (data: UserResponse): User => { return data } export { initialUser, composeUserURL, processUser }