Bugfix/fix base url in trackinsight data enhancer (#2258)
* Fix base url * Update changelog
This commit is contained in:
parent
1f9b9e9998
commit
da6591fca0
@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Refreshed the cryptocurrencies list
|
||||
- Improved the _OSS Friends_ page
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed an issue with the _Trackinsight_ data enhancer for asset profile data
|
||||
|
||||
## 1.302.0 - 2023-08-20
|
||||
|
||||
### Changed
|
||||
|
@ -7,7 +7,7 @@ import got from 'got';
|
||||
|
||||
@Injectable()
|
||||
export class TrackinsightDataEnhancerService implements DataEnhancerInterface {
|
||||
private static baseUrl = 'https://data.trackinsight.com';
|
||||
private static baseUrl = 'https://www.trackinsight.com/data-api';
|
||||
private static countries = require('countries-list/dist/countries.json');
|
||||
private static countriesMapping = {
|
||||
'Russian Federation': 'Russia'
|
||||
@ -33,14 +33,22 @@ export class TrackinsightDataEnhancerService implements DataEnhancerInterface {
|
||||
}
|
||||
|
||||
const profile = await got(
|
||||
`${TrackinsightDataEnhancerService.baseUrl}/data-api/funds/${symbol}.json`
|
||||
`${TrackinsightDataEnhancerService.baseUrl}/funds/${symbol}.json`
|
||||
)
|
||||
.json<any>()
|
||||
.catch(() => {
|
||||
return got(
|
||||
`${TrackinsightDataEnhancerService.baseUrl}/funds/${
|
||||
symbol.split('.')?.[0]
|
||||
}.json`
|
||||
)
|
||||
.json<any>()
|
||||
.catch(() => {
|
||||
return {};
|
||||
});
|
||||
});
|
||||
|
||||
const isin = profile.isin?.split(';')?.[0];
|
||||
const isin = profile?.isin?.split(';')?.[0];
|
||||
|
||||
if (isin) {
|
||||
response.isin = isin;
|
||||
@ -55,7 +63,11 @@ export class TrackinsightDataEnhancerService implements DataEnhancerInterface {
|
||||
`${TrackinsightDataEnhancerService.baseUrl}/holdings/${
|
||||
symbol.split('.')?.[0]
|
||||
}.json`
|
||||
);
|
||||
)
|
||||
.json<any>()
|
||||
.catch(() => {
|
||||
return {};
|
||||
});
|
||||
});
|
||||
|
||||
if (holdings?.weight < 0.95) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user