fix: скрыл инфу о активности ака и перестал выдавать рефреши если ак не активен

This commit is contained in:
2026-05-18 03:15:45 +03:00
parent 934682f035
commit 6eeacd80cc
11 changed files with 206 additions and 8 deletions
+2 -1
View File
@@ -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 = {
+2 -1
View File
@@ -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),
+8
View File
@@ -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