WEB-89 List of currencies on the collateral page is astonishingly long (#2663)

This commit is contained in:
Soni Jay
2025-09-20 19:44:17 -06:00
committed by GitHub
parent dd034f319c
commit 79751111e9
@@ -1,5 +1,6 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
import { OrganizationService } from 'app/organization/organization.service';
import { UntypedFormGroup, UntypedFormBuilder, FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
import { Router, ActivatedRoute, RouterLink } from '@angular/router';
@@ -39,10 +40,19 @@ export class CreateCollateralComponent implements OnInit {
private productsService: ProductsService,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService
private settingsService: SettingsService,
private organizationService: OrganizationService
) {
this.route.data.subscribe((data: { collateralTemplate: any }) => {
this.collateralTemplateData = data.collateralTemplate;
this.organizationService.getCurrencies().subscribe((orgCurrencies: any) => {
console.log('Organization currencies response:', orgCurrencies);
let orgCurrencyList = Array.isArray(orgCurrencies.selectedCurrencyOptions)
? orgCurrencies.selectedCurrencyOptions
: [];
this.collateralTemplateData = data.collateralTemplate.filter((currency: any) =>
orgCurrencyList.some((orgCurrency: any) => orgCurrency.code === currency.code)
);
});
});
}