Изменил логику в группах, вместо семестра теперь пишется год начала обучения, чтобы курс и семестр считались на бэке

This commit is contained in:
ProstoDenya01
2026-03-31 16:44:05 +03:00
parent 73995f86f8
commit 3cdb8614cb
14 changed files with 206 additions and 118 deletions

View File

@@ -83,13 +83,13 @@ export async function initGroups() {
const groupSize = document.getElementById('new-group-size').value;
const educationFormId = newGroupEfSelect.value;
const departmentId = document.getElementById('new-group-department').value;
const course = document.getElementById('new-group-course').value;
const yearStartStudy = document.getElementById('new-group-yearStartStudy').value;
if (!name) { showAlert('create-group-alert', 'Введите название группы', 'error'); return; }
if (!groupSize) { showAlert('create-group-alert', 'Введите размер группы', 'error'); return; }
if (!educationFormId) { showAlert('create-group-alert', 'Выберите форму обучения', 'error'); return; }
if (!departmentId) { showAlert('create-group-alert', 'Введите ID кафедры', 'error'); return; }
if (!course) { showAlert('create-group-alert', 'Введите курс', 'error'); return; }
if (!yearStartStudy) { showAlert('create-group-alert', 'Введите курс', 'error'); return; }
try {
const data = await api.post('/api/groups', {
@@ -97,7 +97,7 @@ export async function initGroups() {
groupSize: Number(groupSize),
educationFormId: Number(educationFormId),
departmentId: Number(departmentId),
course: Number(course)
yearStartStudy: Number(yearStartStudy)
});
showAlert('create-group-alert', `Группа "${escapeHtml(data.name || name)}" создана`, 'success');
createGroupForm.reset();