Feature/improve Ghostfolio data provider integration (#4743)

* Improve Ghostfolio data provider integration
This commit is contained in:
Thomas Kaul 2025-05-24 19:18:46 +01:00 committed by GitHub
parent a8a31c141d
commit 90385157d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -135,7 +135,10 @@ export class AdminService {
}
public async get({ user }: { user: UserWithSettings }): Promise<AdminData> {
const dataSources = await this.dataProviderService.getDataSources({ user });
const dataSources = await this.dataProviderService.getDataSources({
user,
includeGhostfolio: true
});
const [settings, transactionCount, userCount] = await Promise.all([
this.propertyService.get(),

View File

@ -163,8 +163,10 @@ export class DataProviderService {
}
public async getDataSources({
includeGhostfolio = false,
user
}: {
includeGhostfolio?: boolean;
user: UserWithSettings;
}): Promise<DataSource[]> {
let dataSourcesKey: 'DATA_SOURCES' | 'DATA_SOURCES_LEGACY' = 'DATA_SOURCES';
@ -187,7 +189,7 @@ export class DataProviderService {
PROPERTY_API_KEY_GHOSTFOLIO
)) as string;
if (ghostfolioApiKey || hasRole(user, 'ADMIN')) {
if (includeGhostfolio || ghostfolioApiKey) {
dataSources.push('GHOSTFOLIO');
}