beetask/frontend/src/services/userService.ts
Gabriel Santana de Menezes 769791b25c feat: add user profile page with name and email editing
Backend: new UpdateUserProfileUseCase with email uniqueness validation,
PUT /auth/profile endpoint. Frontend: ProfilePage with avatar initials,
inline success/error feedback, and refreshUser() sync after save.
Avatar dropdown in AppShell gains a "Meu Perfil" link.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 15:03:45 -04:00

21 lines
437 B
TypeScript

import { apiFetch } from '../lib/api'
export interface UpdateProfilePayload {
name: string
email: string
}
export interface UpdateProfileResult {
name: string
email: string
photo: string
}
export const userService = {
updateProfile: async (payload: UpdateProfilePayload): Promise<UpdateProfileResult> => {
return apiFetch<UpdateProfileResult>('/auth/profile', {
method: 'PUT',
body: payload,
})
},
}