fixes
This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user