Skip to content

IA-924 : feat(profile): Replace localStorage photo handling with S3 URL support and API-backed persistence

khadija.elbachouri a demandé de fusionner feature/IA-924 vers develop

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_URL when the stored path is relative (not an absolute http URL).

profile-photo-view

  • Removed localStorage-based photo loading.
  • Integrated useAuthContext and useUserStore to load the current user's photo on mount, with S3 URL resolution.
  • handleSaveChanges now calls the appropriate store method (updateAdmin, updateParent, or updateChild) based on userType, passing the selected file for upload.
  • Error handling added around the save flow.

profile-view

  • Avatar src now built dynamically from user.photo + NEXT_PUBLIC_S3_BUCKET_URL instead of reading from localStorage.
  • Initials fallback now uses user.firstName / user.lastName instead of hardcoded values.

Rapports de requête de fusion