From 2111ddaa79873c8a663c69230a638687b3024707 Mon Sep 17 00:00:00 2001 From: JaySoni1 Date: Wed, 17 Sep 2025 16:23:11 +0530 Subject: [PATCH] WEB-89 List of currencies on the collateral page is astonishingly long --- .../create-collateral.component.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/app/products/collaterals/create-collateral/create-collateral.component.ts b/src/app/products/collaterals/create-collateral/create-collateral.component.ts index 0d2bc98fcd..55cfe35a1c 100644 --- a/src/app/products/collaterals/create-collateral/create-collateral.component.ts +++ b/src/app/products/collaterals/create-collateral/create-collateral.component.ts @@ -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) + ); + }); }); }