feat: перелопатил синхронизацию преподавателей
Backend CI / build-and-test (push) Failing after 13m11s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Failing after 10m12s
Frontend CI / build-and-check (push) Failing after 16m9s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Failing after 14m6s
🚀 Create and publish a Docker image / Build & publish backend image (push) Failing after 14m58s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Failing after 14m58s

This commit is contained in:
2026-05-24 21:06:03 +03:00
parent 6aef5dd66f
commit 99d25adbb1
33 changed files with 1756 additions and 90 deletions
+4 -2
View File
@@ -24,15 +24,16 @@ function mapApiRoles(roles: string[] | undefined): UserRole[] {
}
function getDefaultActiveRole(roles: UserRole[]): UserRole {
if (roles.includes('student')) return 'student'
if (roles.includes('teacher')) return 'teacher'
if (roles.includes('admin')) return 'admin'
if (roles.includes('teacher')) return 'teacher'
if (roles.includes('student')) return 'student'
return 'student'
}
export function mapApiUser(user: UserAuthDto | UserDto | CurrentUserDto, stats?: UserStatsDto): User {
const roles = mapApiRoles(user.roles)
return {
id: user.id,
name: user.displayName || user.email || 'Пользователь UniVerse',
email: user.email || '',
roles,
@@ -68,6 +69,7 @@ export function mapApiLecture(lecture: LectureDto): Lecture {
return {
id: String(lecture.id),
teacherId: lecture.teacherId,
title: lecture.title || lecture.courseName || 'Лекция без названия',
description: lecture.description || 'Описание появится позже.',
teacher: lecture.teacherName || 'Преподаватель уточняется',
+1
View File
@@ -29,6 +29,7 @@ export interface LoginMicrosoftRequest {
}
export interface UserAuthDto {
id: number
email: string
displayName?: string | null
roles: ApiUserRole[]