Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Feature/filter item activities from search results (#1759)

Thomas Kaula5b49b286da6
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e84764758f..125b2bbe7c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
+- Filtered activities with type `ITEM` from search results
- Considered the user's language in the _Stripe_ checkout
- Upgraded the _Stripe_ dependencies
- Upgraded `twitter-api-v2` from version `1.10.3` to `1.14.2`
diff --git a/apps/api/src/services/data-provider/manual/manual.service.ts b/apps/api/src/services/data-provider/manual/manual.service.ts
index 9f95029689..876910f964 100644
--- a/apps/api/src/services/data-provider/manual/manual.service.ts
+++ b/apps/api/src/services/data-provider/manual/manual.service.ts
@@ -16,6 +16,7 @@ import { Injectable, Logger } from '@nestjs/common';
import { DataSource, SymbolProfile } from '@prisma/client';
import bent from 'bent';
import * as cheerio from 'cheerio';
+import { isUUID } from 'class-validator';
import { addDays, format, isBefore } from 'date-fns';
@Injectable()
@@ -162,7 +163,7 @@ export class ManualService implements DataProviderInterface {
}
public async search(aQuery: string): Promise<{ items: LookupItem[] }> {
- const items = await this.prismaService.symbolProfile.findMany({
+ let items = await this.prismaService.symbolProfile.findMany({
select: {
currency: true,
dataSource: true,
@@ -189,6 +190,11 @@ export class ManualService implements DataProviderInterface {
}
});
+ items = items.filter(({ symbol }) => {
+ // Remove UUID symbols (activities of type ITEM)
+ return !isUUID(symbol);
+ });
+
return { items };
}
}