import { api } from './api'; import { API_ENDPOINTS } from '@/utils/constants'; import { User, ApiResponse } from '@/types'; export interface UpdateProfileData { firstName?: string; lastName?: string; phone?: string; } export interface ChangePasswordData { currentPassword: string; newPassword: string; } export const userService = { // Get user profile getProfile: async (): Promise => { const response = await api.get>( API_ENDPOINTS.USER.PROFILE ); return response.data!; }, // Update user profile updateProfile: async (data: UpdateProfileData): Promise => { const response = await api.put>( API_ENDPOINTS.USER.UPDATE_PROFILE, data ); return response.data!; }, // Change password changePassword: async (data: ChangePasswordData): Promise => { await api.post(API_ENDPOINTS.USER.CHANGE_PASSWORD, data); }, };