From 5fd724b6821406d77a44a15c261c9a77fd37381a Mon Sep 17 00:00:00 2001 From: berinkrktt <73306985+berinkrktt@users.noreply.github.com> Date: Sun, 22 May 2022 12:15:54 +0300 Subject: [PATCH] Student Registration Screen | SIS-201 (#97) * Student Lesson Registration Page Updated and Fixed. * Student Lesson Registration Page Updated and Fixed. --- pages/student/lesson/registration/index.js | 32 ++++++++++++---------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/pages/student/lesson/registration/index.js b/pages/student/lesson/registration/index.js index 6ff6093..8b547c0 100644 --- a/pages/student/lesson/registration/index.js +++ b/pages/student/lesson/registration/index.js @@ -75,7 +75,9 @@ export async function getServerSideProps(context) { isFirstLessonRegistrationOperationsFeatureToggleEnabled: isFirstLessonRegistrationOperationsFeatureToggleEnabled, isSecondLessonRegistrationOperationsFeatureToggleEnabled: isSecondLessonRegistrationOperationsFeatureToggleEnabled, isLessonRegistrationExist: false, - lessons: lessonsData.response + lessons: lessonsData.response, + operationUserId: studentId, + studentId: studentId } } } @@ -88,7 +90,9 @@ export default function StudentLessonRegistration({ isSecondLessonRegistrationOperationsFeatureToggleEnabled, isLessonRegistrationExist, registrationData, - lessons + lessons, + operationUserId, + studentId }) { if (!isPagePermissionSuccess) { @@ -125,14 +129,14 @@ export default function StudentLessonRegistration({ setIsOpenFailChooseLessonNotification(true); } - let [isOpenProcessingRegistrationNotification, setIsOpenProcessingRegistrationNotification] = useState(false); + let [isOpenProcessingRegistrationLessonNotification, setIsOpenProcessingRegistrationLessonNotification] = useState(false); - function closeProcessingRegistrationNotification() { - setIsOpenProcessingRegistrationNotification(false); + function closeProcessingRegistrationLessonNotification() { + setIsOpenProcessingRegistrationLessonNotification(false); } - function openProcessingRegistrationNotification() { - setIsOpenProcessingRegistrationNotification(true); + function openProcessingRegistrationLessonNotification() { + setIsOpenProcessingRegistrationLessonNotification(true); } let [isOpenSuccessRegistrationLessonNotification, setIsOpenSuccessRegistrationLessonNotification] = useState(false); @@ -178,17 +182,15 @@ export default function StudentLessonRegistration({ } const saveRegistrationLesson = async (event) => { - openProcessingRegistrationNotification(); + openProcessingRegistrationLessonNotification(); event.preventDefault(); - const studentId = SisStudentStorage.getNumber(); - const operationUserId = SisStudentStorage.getNumber(); const studentData = await StudentLessonRegistrationController.saveStudentLessonRegistration(operationUserId, studentLessonIds, studentId); if (studentData.success) { - closeSuccessRegistrationLessonNotification() - openSuccessRegistrationLessonNotification() + closeProcessingRegistrationLessonNotification(); + openSuccessRegistrationLessonNotification(); } else { - closeFailRegistrationLessonNotification() + closeProcessingRegistrationLessonNotification(); openFailRegistrationLessonNotification(); } } @@ -679,8 +681,8 @@ export default function StudentLessonRegistration({ />