Skip to content

Commit

Permalink
Teacher Lesson Registration Screen | SIS-169 (#80)
Browse files Browse the repository at this point in the history
* Warning Updated in Teacher Lesson Registration Screen.

* Get Student Lesson Registration By RegistrationId Updated in Student Lesson Registration Controller.
  • Loading branch information
berinkrktt authored Apr 30, 2022
1 parent bee10cc commit 911582c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 19 deletions.
41 changes: 26 additions & 15 deletions pages/teacher/lesson/registration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import StudentClassLevel from "../../../../public/constants/student/StudentClass
import UnauthorizedAccessPage from "../../../401";
import StudentDegree from "../../../../public/constants/student/StudentDegree";
import SisTeacherStorage from "../../../../public/storage/teacher/SisTeacherStorage";
import StudentLessonRegistrationController from "../../../../public/api/student/lesson/registration/StudentLessonRegistrationController";
import StudentLessonRegistrationController
from "../../../../public/api/student/lesson/registration/StudentLessonRegistrationController";
import RegistrationStatus from "../../../../public/constants/lesson/registration/RegistrationStatus";
import TeacherNavbar from "../../../../public/components/navbar/teacher/teacher-navbar";
import TeacherRole from "../../../../public/constants/teacher/TeacherRole";
Expand Down Expand Up @@ -41,15 +42,16 @@ export default function StudentLessonRegistrationList({isPagePermissionSuccess,
<div>
<SISTitle/>
<TeacherNavbar/>
<div className="max-w-7xl select-none py-5 mx-auto space-y-6">
<div className="px-12 py-10 text-left bg-gray-50 rounded-2xl shadow-xl">
<a className="font-phenomenaExtraBold text-left text-4xl text-sis-darkblue">
DERS KAYDI OLUŞTURAN ÖĞRENCİLERİN LİSTESİ
</a>
</div>
{(
registrations.length !== 0
?
{(
registrations.length !== 0
?
<div className="max-w-7xl select-none py-5 mx-auto space-y-6">
<div className="px-12 py-10 text-left bg-gray-50 rounded-2xl shadow-xl">
<a className="font-phenomenaExtraBold text-left text-4xl text-sis-darkblue">
DERS KAYDI OLUŞTURAN ÖĞRENCİLERİN LİSTESİ
</a>
</div>

<div className="flex flex-col">
<div className="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div className="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8">
Expand Down Expand Up @@ -131,7 +133,7 @@ export default function StudentLessonRegistrationList({isPagePermissionSuccess,
<td className="ml-10 px-6 py-4 text-right font-phenomenaBold text-xl">
<a href={'/teacher/lesson/registration/' + registration.registrationId}
className='text-sis-yellow'>
DETAY
DETAY
</a>
</td>
</tr>
Expand All @@ -142,10 +144,19 @@ export default function StudentLessonRegistrationList({isPagePermissionSuccess,
</div>
</div>
</div>
:
null
)}
</div>
</div>
:
<div className="mt-5 md:mt-0 md:col-span-2">
<div className="px-28 py-5 mx-auto space-y-6">
<div
className="max-w-7xl mx-auto px-12 py-10 text-center bg-gray-50 rounded-2xl shadow-xl">
<a className="select-none font-phenomenaExtraBold text-4xl text-sis-fail">
Henüz Ders Kaydı Oluşturan Öğrenci Bulunmamaktadır!
</a>
</div>
</div>
</div>
)}
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
const SIS_API_URL = process.env.NEXT_PUBLIC_SIS_API_URL;

const getAllLessonRegistrationByStatus = async (status) => {
const apiResult = await fetch(`${SIS_API_URL}/student/lesson/registration/get?status=${status}`, {
const apiResult = await fetch(`${SIS_API_URL}/student/lesson/registration?status=${status}`, {
headers: {'Content-Type': 'application/json'},
method: 'GET'
});
return await apiResult.json();
};

const getAllStudentsLessonRegistrationByRegistrationId = async (registrationId) => {
const apiResult = await fetch(`${SIS_API_URL}/student/lesson/registration/get/${registrationId}`, {
const getStudentLessonRegistrationByRegistrationId = async (registrationId) => {
const apiResult = await fetch(`${SIS_API_URL}/student/lesson/registration/${registrationId}`, {
headers: {'Content-Type': 'application/json'},
method: 'GET'
});
Expand Down Expand Up @@ -69,7 +69,7 @@ const rejectedLessonRegistration = async (operationUserId, registrationId) => {

const StudentLessonRegistrationController = {
getAllLessonRegistrationByStatus,
getAllStudentsLessonRegistrationByRegistrationId,
getStudentLessonRegistrationByRegistrationId,
saveStudentLessonRegistration,
approvedLessonRegistration,
rejectedLessonRegistration
Expand Down

0 comments on commit 911582c

Please sign in to comment.