Browse Source
fix: if yahoo service returns zero quotes do not fail enhance request
Signed-off-by: Anatoly Popov <me@aensidhe.ru>
pull/4715/head
Anatoly Popov
4 weeks ago
Failed to extract signature
1 changed files with
3 additions and
0 deletions
-
apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts
|
@ -102,6 +102,9 @@ export class YahooFinanceDataEnhancerService implements DataEnhancerInterface { |
|
|
yahooSymbol = symbol; |
|
|
yahooSymbol = symbol; |
|
|
} else { |
|
|
} else { |
|
|
const { quotes } = await this.yahooFinance.search(response.isin); |
|
|
const { quotes } = await this.yahooFinance.search(response.isin); |
|
|
|
|
|
if (quotes.length === 0) { |
|
|
|
|
|
return response; |
|
|
|
|
|
} |
|
|
yahooSymbol = quotes[0].symbol as string; |
|
|
yahooSymbol = quotes[0].symbol as string; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|