Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions frontend/main/src/app/carriers/carriers.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) { }

Expand Down Expand Up @@ -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 ={
Expand All @@ -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(){
Expand Down
13 changes: 11 additions & 2 deletions frontend/main/src/app/users/users.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down