Skip to content

Commit

Permalink
mark grading scale id on test as optional, refs #428
Browse files Browse the repository at this point in the history
  • Loading branch information
caebr committed Jul 28, 2022
1 parent c9520f8 commit bbc9cf2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/app/my-grades/services/my-grades.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ export class MyGradesService {

private gradingScaleIdsFromTests$ = this.tests$.pipe(
map((tests: Test[]) =>
[...tests.map((test: Test) => test.GradingScaleId)].filter(unique)
[...tests.map((test: Test) => test.GradingScaleId)]
.filter(notNull)
.filter(unique)
)
);

Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/models/test.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Test = t.type({
IsOwner: t.boolean,
Owner: Option(t.string),
Creation: t.string,
GradingScaleId: t.number,
GradingScaleId: Option(t.number),
GradingScale: t.string,
Results: Option(t.array(Result)),
});
Expand Down
4 changes: 3 additions & 1 deletion src/app/shared/services/dossier-grades.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ export class DossierGradesService {

private gradingScaleIdsFromTests$ = this.tests$.pipe(
map((tests: Test[]) =>
[...tests.map((test: Test) => test.GradingScaleId)].filter(unique)
[...tests.map((test: Test) => test.GradingScaleId)]
.filter(notNull)
.filter(unique)
)
);

Expand Down

0 comments on commit bbc9cf2

Please sign in to comment.