From 7a19fc53b09e61eb4b26301506ff446356178cab Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 24 Dec 2024 13:30:43 +0100 Subject: [PATCH] Feature/improve activities import by isin for yahoo finance (#4140) * Allow activities import by isin even if multiple quotes found * Update changelog --- CHANGELOG.md | 6 ++++++ .../data-enhancer/yahoo-finance/yahoo-finance.service.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74a108262..13862f5cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Changed + +- Improved support to import activities by `isin` in the _Yahoo Finance_ service + ## 2.130.0 - 2024-12-21 ### Added diff --git a/apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts b/apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts index 6090b4f98..b71e3e316 100644 --- a/apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts +++ b/apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts @@ -166,7 +166,7 @@ export class YahooFinanceDataEnhancerService implements DataEnhancerInterface { try { const { quotes } = await yahooFinance.search(symbol); - if (quotes.length === 1) { + if (quotes?.[0]?.symbol) { symbol = quotes[0].symbol; } } catch {}