Изменил метод на получение общего списка занятий. Внёс небольшие правки в FE для странички с расписанием

This commit is contained in:
ProstoDenya01
2026-03-03 17:28:20 +03:00
parent 88f1abfe25
commit 47039ee878
9 changed files with 148 additions and 41 deletions

View File

@@ -27,6 +27,7 @@ export async function initSchedule() {
// Извлекаем имена из вложенных объектов или используем запасные поля
const teacherName = lesson.teacher?.username || lesson.teacherName || '—';
const groupName = lesson.group?.name || lesson.groupName || '—';
const educationForm = lesson.educationForm?.name || lesson.educationFormName || '-';
const subjectName = lesson.subject?.name || lesson.subjectName || '—';
const day = lesson.day || '—';
const week = lesson.week || '—';
@@ -36,6 +37,7 @@ export async function initSchedule() {
<td>${escapeHtml(lesson.id)}</td>
<td>${escapeHtml(teacherName)}</td>
<td>${escapeHtml(groupName)}</td>
<td>${escapeHtml(educationForm)}</td>
<td>${escapeHtml(subjectName)}</td>
<td>${escapeHtml(day)}</td>
<td>${escapeHtml(week)}</td>

View File

@@ -185,7 +185,7 @@ export async function initUsers() {
const response = await api.post('/api/users/lessons/create', {
teacherId: parseInt(userId),
groupId: parseInt(groupId),
lessonTypeId: parseInt(subjectId),
subjectId: parseInt(subjectId),
day: dayOfWeek,
week: weekType,
time: timeSlot // передаём время

View File

@@ -7,6 +7,7 @@
<th>ID</th>
<th>Преподаватель</th>
<th>Группа</th>
<th>Форма обучения</th>
<th>Дисциплина</th>
<th>День недели</th>
<th>Неделя</th>