feat: align frontend types with unified /me API response

- Add THackathonProfile, TQrProfile, TMentorProfile, TSessionProfile
  and TUsersMeResponse types matching the backend unified /me endpoint
- getUserMe() now accepts optional include[] param for selective
  module loading (?include=hackathon,qr,mentor,sessions)
- useSessionQuery() accepts include[] to control which modules load
- Fix SessionUser storage to use optional fields matching backend
- Remove hardcoded fallback values in useLogin (birthdate, gender)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
maulanasdqn
2026-04-10 13:31:32 +07:00
co-authored by Claude Opus 4.6
parent 53ad40f3fd
commit c6719b19e5
4 changed files with 67 additions and 30 deletions
+10 -14
View File
@@ -1,26 +1,22 @@
import type { TPermissionItem } from '../types/permissions';
type TRoleItem = {
id: string;
name: string;
created_at: string;
updated_at: string;
permissions: TPermissionItem[];
};
import type { TRoleDetailItem } from '../types/roles';
import type { THackathonProfile, TQrProfile, TMentorProfile } from '../types/users';
type TUserItem = {
id: string;
avatar: string;
birthdate: string;
avatar?: string;
birthdate?: string;
email: string;
fullname: string;
gender: string;
gender?: string;
is_active: boolean;
phone_number: string;
role: TRoleItem;
phone_number?: string;
role: TRoleDetailItem;
bio?: string;
location?: string;
skills?: string[];
hackathon?: THackathonProfile;
qr?: TQrProfile;
mentor?: TMentorProfile;
};
export const SessionUser = {