diff --git a/CHANGELOG.md b/CHANGELOG.md index d3df5a97c..ccb8fc7d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Extended the tags selector component to support creating custom tags - Extended the holding detail dialog by the historical market data editor (experimental) - Added global styles to the _Storybook_ setup +- Added tags to the activities export ### Changed diff --git a/apps/api/src/app/export/export.module.ts b/apps/api/src/app/export/export.module.ts index 048c60359..892a761cc 100644 --- a/apps/api/src/app/export/export.module.ts +++ b/apps/api/src/app/export/export.module.ts @@ -1,6 +1,7 @@ import { AccountModule } from '@ghostfolio/api/app/account/account.module'; import { OrderModule } from '@ghostfolio/api/app/order/order.module'; import { ApiModule } from '@ghostfolio/api/services/api/api.module'; +import { TagModule } from '@ghostfolio/api/services/tag/tag.module'; import { Module } from '@nestjs/common'; @@ -8,7 +9,7 @@ import { ExportController } from './export.controller'; import { ExportService } from './export.service'; @Module({ - imports: [AccountModule, ApiModule, OrderModule], + imports: [AccountModule, ApiModule, OrderModule, TagModule], controllers: [ExportController], providers: [ExportService] }) diff --git a/apps/api/src/app/export/export.service.ts b/apps/api/src/app/export/export.service.ts index 8162e4e1f..040962bf9 100644 --- a/apps/api/src/app/export/export.service.ts +++ b/apps/api/src/app/export/export.service.ts @@ -45,19 +45,17 @@ export class ExportService { }; } ); - const allTags = ( - await this.tagService.getTags({ - orderBy: { - name: 'asc' - }, - where: { userId } + + const allTags = (await this.tagService.getTagsForUser(userId)) + .filter((value) => { + return value.isUsed; }) - ).map(({ id, name }) => { - return { - id, - name - }; - }); + .map(({ id, name }) => { + return { + id, + name + }; + }); let { activities } = await this.orderService.getOrders({ filters,