import httpClient from '../lib/httpClient' import { GoogleLoginRequestPayload, LoginRequestPayload, LoginResponse, RegisterRequestPayload, RegisterResponse, } from './types' class AuthService { async login(payload: LoginRequestPayload): Promise { const res = await httpClient.post(`/auth/login`, payload) return res.data.data } async loginWithGoogle( payload: GoogleLoginRequestPayload ): Promise { const res = await httpClient.post(`/auth/google-login`, payload) return res.data.data } async register(payload: RegisterRequestPayload): Promise { const res = await httpClient.post(`/auth/register`, payload) return res.data.data } async getCurrentUser() { const res = await httpClient.get(`/auth/who-am-i`) return res.data.data } } export const authService = new AuthService()