Browse Source

save sectors to database

Co-authored-by: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
pull/410/head
Valentin Zickner 4 years ago
parent
commit
fba5e84289
  1. 14
      apps/api/src/services/data-gathering.service.ts

14
apps/api/src/services/data-gathering.service.ts

@ -132,7 +132,15 @@ export class DataGatheringService {
for (const [
symbol,
{ assetClass, assetSubClass, countries, currency, dataSource, name }
{
assetClass,
assetSubClass,
countries,
currency,
dataSource,
name,
sectors
}
] of Object.entries(currentData)) {
try {
await this.prismaService.symbolProfile.upsert({
@ -143,6 +151,7 @@ export class DataGatheringService {
currency,
dataSource,
name,
sectors,
symbol
},
update: {
@ -150,7 +159,8 @@ export class DataGatheringService {
assetSubClass,
countries,
currency,
name
name,
sectors
},
where: {
dataSource_symbol: {

Loading…
Cancel
Save