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

* Expire snapshot cache on holding tags change

* Update changelog
This commit is contained in:
Thomas Kaul 2025-02-03 15:23:37 +01:00 committed by GitHub
parent 3037f7cec6
commit 8878212487
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions

View File

@ -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

View File

@ -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(