From 4a566a69e66dca48a0b57353ff50c504ada70f66 Mon Sep 17 00:00:00 2001 From: Thomas <4159106+dtslvr@users.noreply.github.com> Date: Sat, 26 Feb 2022 22:42:32 +0100 Subject: [PATCH] Migrate to yahoo-finance2 (part 3) --- apps/api/src/app/import/import.service.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts index e1683c867..7d0f152b2 100644 --- a/apps/api/src/app/import/import.service.ts +++ b/apps/api/src/app/import/import.service.ts @@ -125,19 +125,19 @@ export class ImportService { } if (dataSource !== 'MANUAL') { - const result = await this.dataProviderService.get([ + const quotes = await this.dataProviderService.getQuotes([ { dataSource, symbol } ]); - if (result[symbol] === undefined) { + if (quotes[symbol] === undefined) { throw new Error( `orders.${index}.symbol ("${symbol}") is not valid for the specified data source ("${dataSource}")` ); } - if (result[symbol].currency !== currency) { + if (quotes[symbol].currency !== currency) { throw new Error( - `orders.${index}.currency ("${currency}") does not match with "${result[symbol].currency}"` + `orders.${index}.currency ("${currency}") does not match with "${quotes[symbol].currency}"` ); } }