Browse Source

Improve validation of activities and asset profiles when combining custom asset profile symbol with data source other than MANUAL

pull/7721/head
Thomas Kaul 4 days ago
parent
commit
02765ce864
  1. 12
      apps/api/src/app/import/import.service.ts
  2. 2
      apps/api/src/services/data-provider/data-provider.service.ts

12
apps/api/src/app/import/import.service.ts

@ -227,6 +227,18 @@ export class ImportService {
throw new Error(
`assetProfiles.${index}.symbol ("${symbol}") must be a UUID or start with the prefix "${ghostfolioPrefix}_" for the data source ("${DataSource.MANUAL}")`
);
} else if (
dataSource !== DataSource.MANUAL &&
isValidCustomAssetProfileSymbol(symbol)
) {
const maskedDataSource = getMaskedGhostfolioDataSource({
dataSource,
ghostfolioDataSources
});
throw new Error(
`assetProfiles.${index}.symbol ("${symbol}") is not valid for the data source ("${maskedDataSource}")`
);
}
}

2
apps/api/src/services/data-provider/data-provider.service.ts

@ -260,7 +260,7 @@ export class DataProviderService implements OnModuleInit {
isValidCustomAssetProfileSymbol(symbol)
) {
throw new Error(
`${activityPath}.symbol ("${symbol}") is not valid for the specified data source ("${maskedDataSource}")`
`${activityPath}.symbol ("${symbol}") is not valid for the data source ("${maskedDataSource}")`
);
}

Loading…
Cancel
Save