From 944536437dc3275e6c8ed98f5daee50b81d63494 Mon Sep 17 00:00:00 2001 From: Valentin Zickner Date: Wed, 6 Oct 2021 21:43:15 +0200 Subject: [PATCH] add sectors for stock assets Co-authored-by: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> --- .../data-provider/yahoo-finance/yahoo-finance.service.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts b/apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts index fe97d4bfc..eb7d220ca 100644 --- a/apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts +++ b/apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts @@ -96,6 +96,12 @@ export class YahooFinanceService implements DataProviderInterface { response[symbol].countries = [{ code, weight: 1 }]; } } catch {} + + if (value.summaryProfile?.sector) { + response[symbol].sectors = [ + { name: value.summaryProfile?.sector, weight: 1 } + ]; + } } // Add url if available