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

3
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]
})

22
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,

Loading…
Cancel
Save