api/src/controllers/session-phase1.ts
Avoid deeply nested control flow statements. Open
Open
if (!result[youngLigneBus.busId]["meetingPoint"].find((meetingPoint) => meetingPoint._id.toString() === youngMeetingPoint._id.toString())) {
result[youngLigneBus.busId]["meetingPoint"].push(youngMeetingPoint);
}
Avoid deeply nested control flow statements. Open
Open
if (!result[youngLigneBus.busId]["ligneBus"].find((ligne) => ligne._id.toString() === young.ligneId)) {
result[youngLigneBus.busId]["ligneBus"].push(youngLigneBus);
}
Avoid deeply nested control flow statements. Open
Open
if (!result[youngLigneBus.busId]) {
result[youngLigneBus.busId] = {};
result[youngLigneBus.busId]["youngs"] = [];
result[youngLigneBus.busId]["ligneBus"] = [];
result[youngLigneBus.busId]["meetingPoint"] = [];