Chirag4904 / timetable

0 stars 2 forks source link

Fix the bug of subjects alloted to teachers #84

Closed Chirag4904 closed 1 year ago

Chirag4904 commented 1 year ago

Once the teacher is assigned a subject it is stored in alloted Subject array so if the subject is removed from that teacher then the hours are updated to 0 but the object still remains in alloted subjects which is taken by ui and displayed. image

Chirag4904 commented 1 year ago

@RoguedBear I am wondering if it should be handled in frontend or backend. In frontend side I can just add additional checks if all L,T,P hours are equal to 0 then it will not be displayed. Alternatively if in the backend we check if the L,T,P becomes 0 for that alloted subject then that subject should be removed from the allotedSubjects array for that teacher. What do you think?

RoguedBear commented 1 year ago

ideally this should be handled in the backend, when you call the delete teacher api or when the ltp hours reach 0 for a manually added teacher, the backend takes care of all the places to delete that teacher from

Chirag4904 commented 1 year ago

Ok let's see if it's too much hassle for now then we will do it in frontend and keep this issue open otherwise fix it in the backend.

RoguedBear commented 1 year ago

completed in #106