diff --git a/frontend/main/src/app/carriers/carriers.component.ts b/frontend/main/src/app/carriers/carriers.component.ts index aa04fd4..9f54a61 100644 --- a/frontend/main/src/app/carriers/carriers.component.ts +++ b/frontend/main/src/app/carriers/carriers.component.ts @@ -15,7 +15,7 @@ export class CarriersComponent implements OnInit { cnpj!: string email!: string razao!: string - taxa!: number + taxa!: string constructor(public carrierService: CarrierService, public quoteService: QuoteService, private router: Router, private http: HttpClient) { } @@ -46,16 +46,16 @@ export class CarriersComponent implements OnInit { } - this.razao = ""; - this.taxa = 0; - this.email = ""; - this.cnpj = ""; + this.razao = ""; + this.taxa = ""; + this.email = ""; + this.cnpj = ""; }) } - adicionar(razao: string, taxa: number, email: string, cnpj: string) { + adicionar(razao: string, taxa: string, email: string, cnpj: string) { let build ={ @@ -68,7 +68,11 @@ export class CarriersComponent implements OnInit { this.carrierService.adicionar(build) - this.carriers.push({razao:this.razao, taxa:this.taxa, email:this.email, cnpj:this.cnpj}); + setTimeout(() => { + this.ngOnInit(); + }, 500); + + // this.carriers.push({razao:this.razao, taxa:this.taxa, email:this.email, cnpj:this.cnpj}); } deletar(){ diff --git a/frontend/main/src/app/users/users.component.ts b/frontend/main/src/app/users/users.component.ts index c1bd87c..00ee717 100644 --- a/frontend/main/src/app/users/users.component.ts +++ b/frontend/main/src/app/users/users.component.ts @@ -61,14 +61,23 @@ id!: number this.usersService.adicionar(build) - this.users.push({name:this.name, email:this.email, document:this.document, birth:this.birth}); + setTimeout(() => { + this.ngOnInit(); + }, 500); + + // this.users.push({name:this.name, email:this.email, document:this.document, birth:this.birth}); } deletar(id:number){ console.log(id); - this.http.delete('http://localhost:8080/user/'+id); + this.http.delete('http://localhost:8080/user/'+id).subscribe(); + + setTimeout(() => { + this.ngOnInit(); + }, 500); + } alterar(){