Skip to content

Commit 7975111

Browse files
authored
WEB-89 List of currencies on the collateral page is astonishingly long (#2663)
1 parent dd034f3 commit 7975111

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/app/products/collaterals/create-collateral/create-collateral.component.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/** Angular Imports */
22
import { Component, OnInit } from '@angular/core';
3+
import { OrganizationService } from 'app/organization/organization.service';
34
import { UntypedFormGroup, UntypedFormBuilder, FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
45
import { Router, ActivatedRoute, RouterLink } from '@angular/router';
56

@@ -39,10 +40,19 @@ export class CreateCollateralComponent implements OnInit {
3940
private productsService: ProductsService,
4041
private route: ActivatedRoute,
4142
private router: Router,
42-
private settingsService: SettingsService
43+
private settingsService: SettingsService,
44+
private organizationService: OrganizationService
4345
) {
4446
this.route.data.subscribe((data: { collateralTemplate: any }) => {
45-
this.collateralTemplateData = data.collateralTemplate;
47+
this.organizationService.getCurrencies().subscribe((orgCurrencies: any) => {
48+
console.log('Organization currencies response:', orgCurrencies);
49+
let orgCurrencyList = Array.isArray(orgCurrencies.selectedCurrencyOptions)
50+
? orgCurrencies.selectedCurrencyOptions
51+
: [];
52+
this.collateralTemplateData = data.collateralTemplate.filter((currency: any) =>
53+
orgCurrencyList.some((orgCurrency: any) => orgCurrency.code === currency.code)
54+
);
55+
});
4656
});
4757
}
4858

0 commit comments

Comments
 (0)