changes for details
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { AccountService, TenantService } from '../data-object-service';
|
||||
import { Account, Tenant } from '../data-objects';
|
||||
import { MessageService } from '../message.service';
|
||||
import { Location } from '@angular/common'
|
||||
import { MatButton } from '@angular/material/button';
|
||||
|
||||
@Component({
|
||||
selector: 'app-tenant-details',
|
||||
@ -33,13 +33,14 @@ export class TenantDetailsComponent implements OnInit {
|
||||
description: ''
|
||||
}
|
||||
|
||||
@ViewChild('submitButton') submitButton: MatButton
|
||||
|
||||
constructor(
|
||||
private tenantService: TenantService,
|
||||
private accountService: AccountService,
|
||||
private messageService: MessageService,
|
||||
private route: ActivatedRoute,
|
||||
private location: Location
|
||||
private router: Router
|
||||
) { }
|
||||
|
||||
async getTenant(): Promise<void> {
|
||||
@ -55,6 +56,7 @@ export class TenantDetailsComponent implements OnInit {
|
||||
}
|
||||
|
||||
async saveTenant() {
|
||||
this.submitButton.disabled = true
|
||||
this.messageService.add("saveTenant")
|
||||
this.messageService.add(JSON.stringify(this.tenant, undefined, 4))
|
||||
if (this.tenant.id == 0) {
|
||||
@ -70,6 +72,7 @@ export class TenantDetailsComponent implements OnInit {
|
||||
} else {
|
||||
this.messageService.add("about to update existing tenant")
|
||||
}
|
||||
this.router.navigate(['/tenants'])
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
Reference in New Issue
Block a user