Skip to content

Commit

Permalink
fix(type): la réponse est une liste, pas un objet
Browse files Browse the repository at this point in the history
Signed-off-by: camarm-dev <[email protected]>
  • Loading branch information
camarm-dev committed Apr 14, 2024
1 parent 940dafb commit b04290d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions examples/timetable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ login().then(() => {
const todayDate = `${today.getFullYear()}-${month}-${today.getDate()}`;
ED.timetable.fetchByDay(todayDate).then(timetable => {
console.log("\nEmploi du temps d'aujourd'hui:");
Object.keys(timetable).forEach(key => {
const matiere = timetable[key];
timetable.forEach(matiere => {
console.log(`\t${matiere.text ? matiere.text: matiere.matiere} (${matiere.codeMatiere}) avec ${matiere.prof ? matiere.prof: "pas de prof"}, de ${matiere.start_date} à ${matiere.end_date} en salle ${matiere.salle ? matiere.salle: "pas de salle"}.`);
});
});
Expand Down
4 changes: 1 addition & 3 deletions src/utils/types/timetable.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import {course} from "~/types";

interface timetableCourseList {
[key: string]: course
}
type timetableCourseList = course[];

export type {
timetableCourseList
Expand Down

0 comments on commit b04290d

Please sign in to comment.