Skip to content

Commit

Permalink
Now enables students to check if a module is available
Browse files Browse the repository at this point in the history
  • Loading branch information
a2br committed Sep 2, 2021
1 parent a0481bb commit 55f2ba0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/accounts/Student.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
studentAccount,
isStudentAccount,
gradesResSuccess,
studentAccountModule,
} from "ecoledirecte-api-types/v3";
import {
getMainAccount,
Expand Down Expand Up @@ -192,6 +193,10 @@ export class Student extends Account {
return cloud;
}

hasModule(module: studentAccountModule["code"]): boolean {
return this._raw.modules.some(m => m.code === module && m.enable);
}

get _raw(): studentAccount {
return this.account;
}
Expand Down

0 comments on commit 55f2ba0

Please sign in to comment.