Przeglądaj źródła

Merge branch 'master' of onunez/frontend-inversiones into development

Oscar José Nuñez Chávez 5 lat temu
rodzic
commit
9edbd42f97

+ 3 - 0
src/app/components/investment-proposals/investment-proposals.component.html

@@ -112,6 +112,9 @@
                           can_modify_or_send_to_review(
                             row.id_estado_inversion.codigo
                           ) ||
+                          can_write_payment_info(
+                            row.id_estado_inversion.codigo
+                          ) ||
                           (can_finish_proposal(
                             row.id_estado_inversion.codigo
                           ) &&

+ 12 - 1
src/app/components/investment-proposals/payment-info/payment-info.component.ts

@@ -70,6 +70,7 @@ export class PaymentInfoComponent implements OnInit {
   banks: any;
   accounts: any;
   paymentObject: Object;
+  inversionAmount: any;
 
   constructor(
     private router: Router,
@@ -92,6 +93,16 @@ export class PaymentInfoComponent implements OnInit {
       .subscribe(
         res => {
           this.inversionCode = res["result"]["codigo_inversion"];
+          this.inversionAmount =
+            res["result"]["id_inversion_instrumento"]["instrumento"][
+              "valor_nominal"
+            ];
+          this.investmentProposalForm.setValue({
+            monto: this.inversionAmount,
+            tipo_pago: "",
+            cuenta_bancaria: "",
+            fecha_vencimiento: ""
+          });
         },
         err => {
           Swal.fire({
@@ -118,7 +129,7 @@ export class PaymentInfoComponent implements OnInit {
 
     this.investmentProposalForm = this.formBuilder.group({
       monto: [
-        "",
+        this.inversionAmount,
         [
           Validators.required,
           Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)

+ 1 - 1
src/app/services/token.interceptor.ts

@@ -54,7 +54,7 @@ export class TokenInterceptor implements HttpInterceptor {
           }, 2000);
         }
 
-        if (error instanceof HttpErrorResponse && error.status === 422) {
+        if (error instanceof HttpErrorResponse && error.status === 401) {
           return this.handle4xxError(request, next);
         } else {
           return throwError(error);

+ 1 - 1
src/environments/environment.ts

@@ -4,7 +4,7 @@
 
 export const environment = {
   production: false,
-  productionApiUrl: "http://192.168.98.28:8000/api"
+  productionApiUrl: "http://192.168.98.140:8000/api"
   //productionApiUrl: "https://denmark.inverlec.solar/api/v1"
 };