feat: Add user profile photo upload with base64 encoding
Added complete photo upload support for user profiles: - Added photoUrl field to User entity and all auth responses - Created migration V008 for photo_url column in users table - Updated UpdateProfileDto to include photoUrl validation - Modified auth.service.ts to handle photoUrl in all user responses (register, login, getUserById, updateProfile, refreshAccessToken, loginWithExternalAuth) - Updated AuthResponse interface to include photoUrl - Updated frontend User and UserProfile interfaces to include photoUrl - Updated AppShell to display user photoUrl in header avatar - Fixed ChildDialog to remove invalid props from PhotoUpload component The photo upload uses base64 encoding (max 5MB) for simplicity and works across all environments. Future enhancement can migrate to CDN/object storage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -153,8 +153,6 @@ export function ChildDialog({ open, onClose, onSubmit, child, isLoading = false
|
||||
onChange={(url) => setFormData({ ...formData, photoUrl: url })}
|
||||
disabled={isLoading}
|
||||
size={80}
|
||||
childId={child?.id}
|
||||
type="profile"
|
||||
/>
|
||||
</Box>
|
||||
</DialogContent>
|
||||
|
||||
@@ -116,6 +116,7 @@ export const AppShell = ({ children }: AppShellProps) => {
|
||||
}}
|
||||
>
|
||||
<Avatar
|
||||
src={user?.photoUrl}
|
||||
sx={{
|
||||
width: 36,
|
||||
height: 36,
|
||||
|
||||
@@ -17,6 +17,7 @@ export interface UserProfile {
|
||||
id: string;
|
||||
email: string;
|
||||
name: string;
|
||||
photoUrl?: string;
|
||||
role: string;
|
||||
locale: string;
|
||||
emailVerified: boolean;
|
||||
|
||||
@@ -9,6 +9,7 @@ export interface User {
|
||||
id: string;
|
||||
email: string;
|
||||
name: string;
|
||||
photoUrl?: string;
|
||||
role: string;
|
||||
families?: Array<{
|
||||
id: string;
|
||||
|
||||
Reference in New Issue
Block a user