Feature/improve Ghostfolio data provider integration (#4743)
* Improve Ghostfolio data provider integration
This commit is contained in:
parent
a8a31c141d
commit
90385157d7
@ -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(),
|
||||
|
@ -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');
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user