fix: скрыл инфу о активности ака и перестал выдавать рефреши если ак не активен
This commit is contained in:
@@ -16,6 +16,7 @@ import type {
|
||||
SyncStatusDto,
|
||||
TagDto,
|
||||
UserAchievementDto,
|
||||
CurrentUserDto,
|
||||
UserDto,
|
||||
UserQuery,
|
||||
UserNotificationDto,
|
||||
@@ -30,7 +31,7 @@ export const authApi = {
|
||||
}),
|
||||
refresh: () => apiRequest<AuthResponse>('/auth/refresh', { method: 'POST' }),
|
||||
logout: () => apiRequest<void>('/auth/logout', { method: 'POST' }),
|
||||
me: () => apiRequest<UserDto>('/auth/me'),
|
||||
me: () => apiRequest<CurrentUserDto>('/auth/me'),
|
||||
}
|
||||
|
||||
export const lecturesApi = {
|
||||
|
||||
@@ -4,6 +4,7 @@ import type {
|
||||
CoinTransactionDto,
|
||||
LectureDto,
|
||||
ReviewDto,
|
||||
CurrentUserDto,
|
||||
UserAuthDto,
|
||||
UserDto,
|
||||
UserStatsDto,
|
||||
@@ -29,7 +30,7 @@ function getDefaultActiveRole(roles: UserRole[]): UserRole {
|
||||
return 'student'
|
||||
}
|
||||
|
||||
export function mapApiUser(user: UserAuthDto | UserDto, stats?: UserStatsDto): User {
|
||||
export function mapApiUser(user: UserAuthDto | UserDto | CurrentUserDto, stats?: UserStatsDto): User {
|
||||
const roles = mapApiRoles(user.roles)
|
||||
return {
|
||||
id: String(user.id),
|
||||
|
||||
@@ -44,6 +44,14 @@ export interface UserDto extends UserAuthDto {
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface CurrentUserDto extends UserAuthDto {
|
||||
avatarUrl?: string | null
|
||||
xp: number
|
||||
coins: number
|
||||
level: number
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface UserQuery {
|
||||
Search?: string
|
||||
Role?: ApiUserRole
|
||||
|
||||
Reference in New Issue
Block a user