Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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)
);
});
});
}

Expand Down