From 6d510cd29e097c63c00287f98f88b153aaba0d14 Mon Sep 17 00:00:00 2001 From: Mateus Felipe Date: Mon, 3 Oct 2022 21:27:23 -0300 Subject: [PATCH] Updated list recent quotes and register --- frontend/main/src/app/carrier.service.ts | 7 ++++--- frontend/main/src/app/rct-qt/rct-qt.component.ts | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/frontend/main/src/app/carrier.service.ts b/frontend/main/src/app/carrier.service.ts index 8a7b74d..aada518 100644 --- a/frontend/main/src/app/carrier.service.ts +++ b/frontend/main/src/app/carrier.service.ts @@ -31,9 +31,10 @@ export class CarrierService { findName(id: number):any{ - this.http.get(this.apiURL+`/`+id).subscribe((response)=>{ - return response - }) + return this.http.get(this.apiURL+'/'+id) + + + } diff --git a/frontend/main/src/app/rct-qt/rct-qt.component.ts b/frontend/main/src/app/rct-qt/rct-qt.component.ts index 1cbccbc..df6f13a 100644 --- a/frontend/main/src/app/rct-qt/rct-qt.component.ts +++ b/frontend/main/src/app/rct-qt/rct-qt.component.ts @@ -24,6 +24,7 @@ export class RctQtComponent implements OnInit { pessoa_id!: number nomePessoa!: string razaoTransportadora!: string + carrier!: any @@ -48,10 +49,21 @@ export class RctQtComponent implements OnInit { this.cub_height = response[i].cub_height - this.razaoTransportadora = this.carrierService.findName(response.carrier_id); + + + this.carrierService.findName(response[i].carrier_id).subscribe((response:any) => { + + this.recQuotes.push({id: this.id, price: this.price, await: this.await, origin: this.origin, destiny: this.destiny, cub_height: this.cub_height, razaoTransportadora: response.razao, carrier_id: response.id, nomePessoa: this.loginService.nome}) + + + }) - this.recQuotes.push({id: this.id, price: this.price, await: this.await, origin: this.origin, destiny: this.destiny, cub_height: this.cub_height, razaoTransportadora: this.razaoTransportadora, carrier_id: response.carrier_id, nomePessoa: this.loginService.nome}) + + + + + }