Skip to content

Commit

Permalink
fix(schedules): do not display dropwdown if student cannot be found
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao committed Dec 16, 2023
1 parent d05de03 commit 67aed73
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/current/classes/Persons.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,18 +416,20 @@ PersonsClass.prototype.getByAssignment = function (payload) {
if (stuForAssistant) {
const main = Persons.get(stuForAssistant);

dbPersons = appData.filter(
(person) =>
person.isMale === main.isMale &&
person.isFemale === main.isFemale &&
(person.assignments.find((assignment) => assignment.code === 101) ||
person.assignments.find((assignment) => assignment.code === 102) ||
person.assignments.find((assignment) => assignment.code === 103) ||
person.assignments.find((assignment) => assignment.code === 123) ||
person.assignments.find((assignment) => assignment.code === 124) ||
person.assignments.find((assignment) => assignment.code === 125) ||
person.assignments.find((assignment) => assignment.code === 126))
);
if (main) {
dbPersons = appData.filter(
(person) =>
person.isMale === main.isMale &&
person.isFemale === main.isFemale &&
(person.assignments.find((assignment) => assignment.code === 101) ||
person.assignments.find((assignment) => assignment.code === 102) ||
person.assignments.find((assignment) => assignment.code === 103) ||
person.assignments.find((assignment) => assignment.code === 123) ||
person.assignments.find((assignment) => assignment.code === 124) ||
person.assignments.find((assignment) => assignment.code === 125) ||
person.assignments.find((assignment) => assignment.code === 126))
);
}
}
} else {
if (assType === 121) {
Expand Down

0 comments on commit 67aed73

Please sign in to comment.