IA-924 : feat(profile): Replace localStorage photo handling with S3 URL support and API-backed persistence
Summary
Refactors profile photo handling across multiple components to use real backend data instead of localStorage, and ensures S3-hosted images are correctly resolved.
Changes
account-drawer
- Profile photo URL now prefixed with
NEXT_PUBLIC_S3_BUCKET_URLwhen the stored path is relative (not an absolutehttpURL).
profile-photo-view
- Removed localStorage-based photo loading.
- Integrated
useAuthContextanduseUserStoreto load the current user's photo on mount, with S3 URL resolution. -
handleSaveChangesnow calls the appropriate store method (updateAdmin,updateParent, orupdateChild) based onuserType, passing the selected file for upload. - Error handling added around the save flow.
profile-view
- Avatar
srcnow built dynamically fromuser.photo+NEXT_PUBLIC_S3_BUCKET_URLinstead of reading from localStorage. - Initials fallback now uses
user.firstName/user.lastNameinstead of hardcoded values.