IA-938 "feat(profile): integrate real API for history and sessions"
Description
Replaced all static/mock data in the profile-related views with real API integration.
HistoryView (history-view.tsx)
- Removed hardcoded
activityHistoryandactiveSessionsarrays - Added
fetchActivityLogandfetchSessionsusingaxiosInstancewith loading/error states (Skeleton,Alert) -
handleSessionLogoutandhandleLogoutAllnow call real DELETE endpoints - Added
getActivityIcon()helper to derive icons dynamically from activity type - Date formatting now handles both array (Java
LocalDateTime) and ISO string formats
ProfilePhotoView (profile-photo-view.tsx)
- Admin photo save now uses a dedicated
multipart/form-dataPUT request to/api/user-management/admins/current-user/photoinstead of the genericupdateAdminstore method - Added
axiosInstanceimport for direct API calls
axios.ts (endpoints)
- Updated
baseURLto useNEXT_PUBLIC_HOST_GATEWAY_API_URLenv variable instead ofCONFIG.site.serverUrl - Added
admin.currentUserandadmin.currentUserPhotoendpoints - Added
history.activityLogandhistory.sessionsendpoints