Shane Greaves
6 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
9 additions and
4 deletions
-
apps/api/src/app/app.controller.ts
-
apps/api/src/services/data-provider/manual/manual.service.ts
-
apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts
|
|
|
@ -1,9 +1,11 @@ |
|
|
|
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; |
|
|
|
|
|
|
|
import { Controller } from '@nestjs/common'; |
|
|
|
import { Controller, Logger } from '@nestjs/common'; |
|
|
|
|
|
|
|
@Controller() |
|
|
|
export class AppController { |
|
|
|
private readonly logger = new Logger(AppController.name); |
|
|
|
|
|
|
|
public constructor( |
|
|
|
private readonly exchangeRateDataService: ExchangeRateDataService |
|
|
|
) { |
|
|
|
@ -13,6 +15,8 @@ export class AppController { |
|
|
|
private async initialize() { |
|
|
|
try { |
|
|
|
await this.exchangeRateDataService.initialize(); |
|
|
|
} catch {} |
|
|
|
} catch (error) { |
|
|
|
this.logger.error(error); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -161,7 +161,8 @@ export class ManualService implements DataProviderInterface { |
|
|
|
where: { |
|
|
|
symbol: { |
|
|
|
in: symbols |
|
|
|
} |
|
|
|
}, |
|
|
|
dataSource: this.getName() |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
@ -203,7 +203,7 @@ export class ExchangeRateDataService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const resultExtended = result; |
|
|
|
const resultExtended = { ...result }; |
|
|
|
|
|
|
|
for (const symbol of Object.keys(result)) { |
|
|
|
const [currency1, currency2] = symbol.match(/.{1,3}/g); |
|
|
|
|