Browse Source

Feature/expire snapshot cache on holding tags change (#4277)

* Expire snapshot cache on holding tags change

* Update changelog
pull/3899/head
Thomas Kaul 1 week ago
committed by GitHub
parent
commit
8878212487
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 13
      apps/api/src/app/order/order.service.ts

1
CHANGELOG.md

@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Improved the caching of the portfolio snapshot in the portfolio calculator by expiring cache entries when a user changes tags in the holding detail dialog
- Improved the language localization for German (`de`) - Improved the language localization for German (`de`)
## 2.137.1 - 2025-02-01 ## 2.137.1 - 2025-02-01

13
apps/api/src/app/order/order.service.ts

@ -63,14 +63,14 @@ export class OrderService {
} }
}); });
return Promise.all( await Promise.all(
orders.map(({ id }) => orders.map(({ id }) =>
this.prismaService.order.update({ this.prismaService.order.update({
data: { data: {
tags: { tags: {
// The set operation replaces all existing connections with the provided ones // The set operation replaces all existing connections with the provided ones
set: tags.map(({ id }) => { set: tags.map((tag) => {
return { id }; return { id: tag.id };
}) })
} }
}, },
@ -78,6 +78,13 @@ export class OrderService {
}) })
) )
); );
this.eventEmitter.emit(
PortfolioChangedEvent.getName(),
new PortfolioChangedEvent({
userId
})
);
} }
public async createOrder( public async createOrder(

Loading…
Cancel
Save