Browse Source

feat(gh-4327): use tags specific for user filtered by isUsed

pull/4337/head
Sayed Murtadha Ahmed 3 months ago
committed by Thomas Kaul
parent
commit
a60b71273d
  1. 1
      CHANGELOG.md
  2. 3
      apps/api/src/app/export/export.module.ts
  3. 22
      apps/api/src/app/export/export.service.ts

1
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 tags selector component to support creating custom tags
- Extended the holding detail dialog by the historical market data editor (experimental) - Extended the holding detail dialog by the historical market data editor (experimental)
- Added global styles to the _Storybook_ setup - Added global styles to the _Storybook_ setup
- Added tags to the activities export
### Changed ### Changed

3
apps/api/src/app/export/export.module.ts

@ -1,6 +1,7 @@
import { AccountModule } from '@ghostfolio/api/app/account/account.module'; import { AccountModule } from '@ghostfolio/api/app/account/account.module';
import { OrderModule } from '@ghostfolio/api/app/order/order.module'; import { OrderModule } from '@ghostfolio/api/app/order/order.module';
import { ApiModule } from '@ghostfolio/api/services/api/api.module'; import { ApiModule } from '@ghostfolio/api/services/api/api.module';
import { TagModule } from '@ghostfolio/api/services/tag/tag.module';
import { Module } from '@nestjs/common'; import { Module } from '@nestjs/common';
@ -8,7 +9,7 @@ import { ExportController } from './export.controller';
import { ExportService } from './export.service'; import { ExportService } from './export.service';
@Module({ @Module({
imports: [AccountModule, ApiModule, OrderModule], imports: [AccountModule, ApiModule, OrderModule, TagModule],
controllers: [ExportController], controllers: [ExportController],
providers: [ExportService] providers: [ExportService]
}) })

22
apps/api/src/app/export/export.service.ts

@ -45,19 +45,17 @@ export class ExportService {
}; };
} }
); );
const allTags = (
await this.tagService.getTags({ const allTags = (await this.tagService.getTagsForUser(userId))
orderBy: { .filter((value) => {
name: 'asc' return value.isUsed;
},
where: { userId }
}) })
).map(({ id, name }) => { .map(({ id, name }) => {
return { return {
id, id,
name name
}; };
}); });
let { activities } = await this.orderService.getOrders({ let { activities } = await this.orderService.getOrders({
filters, filters,

Loading…
Cancel
Save