option to insert new tenant
This commit is contained in:
@ -39,15 +39,22 @@ export class TenantDetailsComponent implements OnInit {
|
||||
async getTenant(): Promise<void> {
|
||||
try {
|
||||
const id = +this.route.snapshot.paramMap.get('id')
|
||||
this.tenant = await this.tenantService.getTenant(id)
|
||||
if (id != 0) {
|
||||
this.tenant = await this.tenantService.getTenant(id)
|
||||
}
|
||||
} catch (err) {
|
||||
this.messageService.add(JSON.stringify(err, undefined, 4))
|
||||
}
|
||||
}
|
||||
|
||||
updateTenant() {
|
||||
this.messageService.add("updateTenant")
|
||||
saveTenant() {
|
||||
this.messageService.add("saveTenant")
|
||||
this.messageService.add(JSON.stringify(this.tenant, undefined, 4))
|
||||
if (this.tenant.id == 0) {
|
||||
this.messageService.add("about to insert new tenant")
|
||||
} else {
|
||||
this.messageService.add("about to update existing tenant")
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
Reference in New Issue
Block a user