fix order of treatments sections

This commit is contained in:
2023-11-06 22:11:32 +01:00
parent a32a9ceb66
commit 2a71524155
2 changed files with 3 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ export class TreatmentDetailsModalComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.details = this.treatmentsService.getTreatmentDetails(this.treatmentCode); this.details = this.treatmentsService.getTreatmentDetails(this.treatmentCode);
this.details.sections = this.details.sections.sort((s1: Section, s2: Section) => (s1.type === "free") ? 1 : -1); this.details.sections = this.details.sections.sort((s1: Section, s2: Section) => (s1.type === "free") ? 1 : 0);
} }
@HostListener('document:keydown.escape', ['$event']) onKeydownHandler(event: KeyboardEvent) { @HostListener('document:keydown.escape', ['$event']) onKeydownHandler(event: KeyboardEvent) {

View File

@@ -118,6 +118,8 @@ export class TreatmentsService {
if(currentTreatmentDetails){ if(currentTreatmentDetails){
this.TREATMENT_DETAILS.push(currentTreatmentDetails); this.TREATMENT_DETAILS.push(currentTreatmentDetails);
} }
console.log(this.TREATMENT_DETAILS)
}); });
} }