Browse Source

Merge branch 'main' into task/improve-error-handling-in-html-template-middleware

pull/7331/head
Thomas Kaul 2 months ago
committed by GitHub
parent
commit
6b528cda1e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 2
      apps/api/src/services/data-provider/data-provider.service.ts
  3. 14
      apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts

2
CHANGELOG.md

@ -24,7 +24,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Resolved a startup error in data gathering caused by uninitialized data provider mappings
- Improved the error handling in the `HtmlTemplateMiddleware` - Improved the error handling in the `HtmlTemplateMiddleware`
- Improved the error handling in the get quotes functionality of the _Financial Modeling Prep_ service
## 3.26.0 - 2026-07-14 ## 3.26.0 - 2026-07-14

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

@ -44,7 +44,7 @@ import { AssetProfileInvalidError } from './errors/asset-profile-invalid.error';
export class DataProviderService implements OnModuleInit { export class DataProviderService implements OnModuleInit {
private readonly logger = new Logger(DataProviderService.name); private readonly logger = new Logger(DataProviderService.name);
private dataProviderMapping: { [dataProviderName: string]: string }; private dataProviderMapping: { [dataProviderName: string]: string } = {};
public constructor( public constructor(
private readonly configurationService: ConfigurationService, private readonly configurationService: ConfigurationService,

14
apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts

@ -47,7 +47,7 @@ import {
isSameDay, isSameDay,
parseISO parseISO
} from 'date-fns'; } from 'date-fns';
import { uniqBy } from 'lodash'; import { isArray, uniqBy } from 'lodash';
@Injectable() @Injectable()
export class FinancialModelingPrepService export class FinancialModelingPrepService
@ -440,10 +440,14 @@ export class FinancialModelingPrepService
signal: AbortSignal.timeout(requestTimeout) signal: AbortSignal.timeout(requestTimeout)
} }
) )
.then( .then(async (res) => {
(res) => const json = (await res.json()) as unknown as {
res.json() as unknown as { price: number; symbol: string }[] price: number;
) symbol: string;
}[];
return isArray(json) ? json : [];
})
]); ]);
for (const { currency, symbolTarget } of assetProfileResolutions) { for (const { currency, symbolTarget } of assetProfileResolutions) {

Loading…
Cancel
Save