more details pages

This commit is contained in:
2021-09-02 15:50:29 +02:00
parent ce4ff75bca
commit 7c180f0986
16 changed files with 348 additions and 24 deletions

View File

@ -17,7 +17,7 @@ interface DN_Flat {
export class MyFlatsComponent implements OnInit {
flats: Flat[]
premises: Premise[]
dnFlats: DN_Flat[]
dnFlats: DN_Flat[] = []
dataSource: MatTableDataSource<DN_Flat>
displayedColumns: string[] = ["description", "premise", "area", "flat_no"]
@ -39,20 +39,18 @@ export class MyFlatsComponent implements OnInit {
const premisesDict = new Map<number, Premise>()
for (let p of this.premises) {
this.messageService.add(`p2pd: ${p.id}`)
premisesDict.set(p.id, p)
}
this.messageService.add(`premisesDict: ${ JSON.stringify(premisesDict, undefined, 4) }`)
for (let f of this.flats) {
this.dnFlats.push({
flat: f,
premise: premisesDict.get(f.premise)
})
}
this.messageService.add(`dnFlats: { JSON.stringify(this.dnFlats, undefined, 4) }`)
this.dataSource = new MatTableDataSource<DN_Flat>(this.dnFlats)
} catch (err) {
// throw err
this.messageService.add(`Error in getFlats: ${ JSON.stringify(err, undefined, 4) }`)
}
}