Add comprehensive .gitignore
This commit is contained in:
31
maternal-web/lib/api/users.ts
Normal file
31
maternal-web/lib/api/users.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
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;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user