This commit is contained in:
2021-09-10 12:40:48 +02:00
parent 2da6b667bc
commit 2a23d88dd9
3 changed files with 13 additions and 6 deletions

View File

@ -44,11 +44,17 @@ export class FlatDetailsComponent implements OnInit {
async getFlat(): Promise<void> {
try {
const id = +this.route.snapshot.paramMap.get('id')
this.messageService.add(`getFlat ${id}`)
if (id != 0) {
this.flat = await this.flatService.getFlat(id)
this.premise = await this.premiseService.getPremise(this.flat.premise)
this.mappedOverheadAdvances = await this.extApiService.getOverheadAdvancesByFlat(this.flat.id)
this.dataSource = new MatTableDataSource<OverheadAdvance>(this.mappedOverheadAdvances)
} else {
this.flat = NULL_Flat
this.premise = NULL_Premise
this.mappedOverheadAdvances = undefined
this.dataSource = undefined
}
} catch (err) {
throw err
@ -116,6 +122,7 @@ export class FlatDetailsComponent implements OnInit {
}
ngOnInit(): void {
this.messageService.add("FlatDetailsComponent.ngOnInit")
this.getPremises()
this.getOverheadAdvances()
this.getFlat()