import { API_URL } from '../../config'
import { UserResponse, User } from './types'

const initialUser: User = {
    id: -1,
    nickname: '',
    regDate: '',
    points: -1,
}

const composeUserURL = () => (
    API_URL + '/users/me?'
)

const processUser = (data: UserResponse): User => {
    return {
        ...data,
        regDate: data.reg_date,
    }
}

export { initialUser, composeUserURL, processUser }
