Browse Source

Improve data source encoding

pull/7138/head
Thomas Kaul 3 weeks ago
parent
commit
666de5c445
  1. 10
      apps/api/src/interceptors/transform-data-source-in-response/transform-data-source-in-response.interceptor.ts

10
apps/api/src/interceptors/transform-data-source-in-response/transform-data-source-in-response.interceptor.ts

@ -53,9 +53,9 @@ export class TransformDataSourceInResponseInterceptor<
return next.handle().pipe( return next.handle().pipe(
map((data: any) => { map((data: any) => {
if (this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) { if (this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) {
const valueMap = { const valueMap = hasRole(user, 'ADMIN')
...(hasRole(user, 'ADMIN') ? {} : this.encodedDataSourceMap) ? {}
}; : { ...this.encodedDataSourceMap };
if (isExportMode) { if (isExportMode) {
const ghostfolioDataSources = this.configurationService.get( const ghostfolioDataSources = this.configurationService.get(
@ -70,6 +70,10 @@ export class TransformDataSourceInResponseInterceptor<
} }
} }
if (Object.keys(valueMap).length === 0) {
return data;
}
data = redactPaths({ data = redactPaths({
valueMap, valueMap,
object: data, object: data,

Loading…
Cancel
Save