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:
co-authored by
Claude Opus 4.6
parent
53ad40f3fd
commit
c6719b19e5
@@ -4,6 +4,7 @@ import type {
|
||||
TUsersDetailItem,
|
||||
TUserCreateRequest,
|
||||
TUserUpdateRequest,
|
||||
TUsersMeResponse,
|
||||
} from '../../types/users';
|
||||
import type { TApiPaginated, TPaginationParams } from '../../types/common';
|
||||
|
||||
@@ -11,13 +12,16 @@ import type { TApiPaginated, TPaginationParams } from '../../types/common';
|
||||
export type UserDetailResponseDto = TUsersDetailItem;
|
||||
export type UserUpdateRequestDto = TUserUpdateRequest;
|
||||
|
||||
export type TUserMeInclude = 'hackathon' | 'qr' | 'mentor' | 'sessions';
|
||||
|
||||
export const getUserList = async (params?: TPaginationParams): Promise<TApiPaginated<TUsersListItem>> => {
|
||||
const response = await api.get<TApiPaginated<TUsersListItem>>('/v1/iam/users', { params });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const getUserMe = async (): Promise<TUsersDetailItem> => {
|
||||
const response = await api.get<ApiResponse<TUsersDetailItem>>('/v1/iam/users/me');
|
||||
export const getUserMe = async (include?: TUserMeInclude[]): Promise<TUsersMeResponse> => {
|
||||
const params = include?.length ? { include: include.join(',') } : undefined;
|
||||
const response = await api.get<ApiResponse<TUsersMeResponse>>('/v1/iam/users/me', { params });
|
||||
return response.data.data;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user