Files
maternal-app/maternal-web/lib/api/users.ts
2025-10-01 19:01:52 +00:00

32 lines
675 B
TypeScript

import apiClient from './client';
export interface UserPreferences {
notifications?: boolean;
emailUpdates?: boolean;
darkMode?: boolean;
}
export interface UpdateProfileData {
name?: string;
preferences?: UserPreferences;
}
export interface UserProfile {
id: string;
email: string;
name: string;
role: string;
locale: string;
emailVerified: boolean;
preferences?: UserPreferences;
families?: string[];
}
export const usersApi = {
// Update user profile
updateProfile: async (data: UpdateProfileData): Promise<UserProfile> => {
const response = await apiClient.patch('/api/v1/auth/profile', data);
return response.data.data;
},
};