Browse Source

Expose DATA_SOURCE_IMPORT (defaultDataSource) in the info service #2288

pull/4056/head
Brandon Wortman 9 months ago
parent
commit
4b1678e3c4
  1. 3
      apps/api/src/app/info/info.service.ts
  2. 3
      libs/common/src/lib/interfaces/info-item.interface.ts

3
apps/api/src/app/info/info.service.ts

@ -3,6 +3,7 @@ import { PlatformService } from '@ghostfolio/api/app/platform/platform.service';
import { RedisCacheService } from '@ghostfolio/api/app/redis-cache/redis-cache.service'; import { RedisCacheService } from '@ghostfolio/api/app/redis-cache/redis-cache.service';
import { UserService } from '@ghostfolio/api/app/user/user.service'; import { UserService } from '@ghostfolio/api/app/user/user.service';
import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service'; import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service';
import { DataProviderService } from '@ghostfolio/api/services/data-provider/data-provider.service';
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service';
import { PropertyService } from '@ghostfolio/api/services/property/property.service'; import { PropertyService } from '@ghostfolio/api/services/property/property.service';
import { import {
@ -42,6 +43,7 @@ export class InfoService {
public constructor( public constructor(
private readonly benchmarkService: BenchmarkService, private readonly benchmarkService: BenchmarkService,
private readonly configurationService: ConfigurationService, private readonly configurationService: ConfigurationService,
private readonly dataProviderService: DataProviderService,
private readonly exchangeRateDataService: ExchangeRateDataService, private readonly exchangeRateDataService: ExchangeRateDataService,
private readonly jwtService: JwtService, private readonly jwtService: JwtService,
private readonly platformService: PlatformService, private readonly platformService: PlatformService,
@ -121,6 +123,7 @@ export class InfoService {
return { return {
...info, ...info,
benchmarks, benchmarks,
defaultDataSource: this.dataProviderService.getDataSourceForImport(),
demoAuthToken, demoAuthToken,
globalPermissions, globalPermissions,
isReadOnlyMode, isReadOnlyMode,

3
libs/common/src/lib/interfaces/info-item.interface.ts

@ -1,6 +1,6 @@
import { SubscriptionOfferKey } from '@ghostfolio/common/types'; import { SubscriptionOfferKey } from '@ghostfolio/common/types';
import { Platform, SymbolProfile } from '@prisma/client'; import { DataSource, Platform, SymbolProfile } from '@prisma/client';
import { Statistics } from './statistics.interface'; import { Statistics } from './statistics.interface';
import { SubscriptionOffer } from './subscription-offer.interface'; import { SubscriptionOffer } from './subscription-offer.interface';
@ -10,6 +10,7 @@ export interface InfoItem {
benchmarks: Partial<SymbolProfile>[]; benchmarks: Partial<SymbolProfile>[];
countriesOfSubscribers?: string[]; countriesOfSubscribers?: string[];
currencies: string[]; currencies: string[];
defaultDataSource: DataSource;
demoAuthToken: string; demoAuthToken: string;
fearAndGreedDataSource?: string; fearAndGreedDataSource?: string;
globalPermissions: string[]; globalPermissions: string[];

Loading…
Cancel
Save