Browse Source
Bugfix/fix base url in trackinsight data enhancer (#2258)
* Fix base url
* Update changelog
pull/2261/head
Thomas Kaul
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
21 additions and
5 deletions
-
CHANGELOG.md
-
apps/api/src/services/data-provider/data-enhancer/trackinsight/trackinsight.service.ts
|
|
@ -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 {}; |
|
|
|
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) { |
|
|
|