feat: добавил ограничение записи на лекции
Backend CI / build-and-test (push) Failing after 32s
Frontend CI / build-and-check (push) Failing after 5m5s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 6s
🚀 Create and publish a Docker image / Build & publish backend image (push) Failing after 1m28s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Failing after 19s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Has been skipped
Backend CI / build-and-test (push) Failing after 32s
Frontend CI / build-and-check (push) Failing after 5m5s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 6s
🚀 Create and publish a Docker image / Build & publish backend image (push) Failing after 1m28s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Failing after 19s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Has been skipped
This commit is contained in:
@@ -68,6 +68,8 @@ export async function apiRequest<T>(
|
||||
const message =
|
||||
typeof body === 'object' && body && 'message' in body
|
||||
? String((body as { message: unknown }).message)
|
||||
: typeof body === 'object' && body && 'detail' in body
|
||||
? String((body as { detail: unknown }).detail)
|
||||
: `API request failed with status ${response.status}`
|
||||
throw new ApiError(message, response.status, body)
|
||||
}
|
||||
|
||||
@@ -50,6 +50,9 @@ export function mapApiUser(user: UserAuthDto | UserDto | CurrentUserDto, stats?:
|
||||
lecturesAttended: stats?.attendedLectures ?? 0,
|
||||
hoursLearned: stats ? Math.round(stats.attendedLectures * 1.5 * 10) / 10 : 0,
|
||||
achievements: stats ? Array.from({ length: stats.achievementsCount }, (_, index) => String(index + 1)) : [],
|
||||
activeEnrollments: stats?.activeEnrollments,
|
||||
enrollmentSlotLimit: stats?.enrollmentSlotLimit,
|
||||
enrollmentSlotRules: stats?.enrollmentSlotRules,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,14 @@ export interface UserStatsDto {
|
||||
achievementsCount: number
|
||||
currentLevelXp: number
|
||||
nextLevelXp?: number | null
|
||||
activeEnrollments: number
|
||||
enrollmentSlotLimit: number
|
||||
enrollmentSlotRules: EnrollmentSlotRuleDto[]
|
||||
}
|
||||
|
||||
export interface EnrollmentSlotRuleDto {
|
||||
level: number
|
||||
slots: number
|
||||
}
|
||||
|
||||
export interface LectureDto {
|
||||
|
||||
Reference in New Issue
Block a user