fix an error for results without FoS

This commit is contained in:
Alex Martzios 2023-05-02 12:47:49 +03:00
parent 84bd4b24b8
commit 8a8a7e4152
1 changed files with 5 additions and 3 deletions

View File

@ -312,9 +312,11 @@ export class ResultLandingService {
this.resultLandingInfo.subjects = subjectResults[0];
this.resultLandingInfo.otherSubjects = subjectResults[1];
this.resultLandingInfo.classifiedSubjects = subjectResults[2];
if (subjectResults[3]) {
subjectResults[3].forEach(element => {
this.resultLandingInfo.fos.push({id: element, label: element.replace(/^\d+/, '').trim()});
});
}
if (this.resultLandingInfo.fos) {
this.resultLandingInfo.fos.sort((a, b) => a.id.localeCompare(b.id));
}