Bugfix/fix search for holding in assistant (#3569)
* Fix search for holding * Update changelog
This commit is contained in:
parent
89be438e66
commit
6c1317f978
@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Fixed an issue in the portfolio summary with the currency conversion of fees
|
- Fixed an issue in the portfolio summary with the currency conversion of fees
|
||||||
|
- Fixed an issue in the the search for a holding
|
||||||
- Removed the show condition of the experimental features setting in the user settings
|
- Removed the show condition of the experimental features setting in the user settings
|
||||||
|
|
||||||
## 2.95.0 - 2024-07-12
|
## 2.95.0 - 2024-07-12
|
||||||
|
@ -174,8 +174,8 @@ export class AccountService {
|
|||||||
ACCOUNT: filtersByAccount,
|
ACCOUNT: filtersByAccount,
|
||||||
ASSET_CLASS: filtersByAssetClass,
|
ASSET_CLASS: filtersByAssetClass,
|
||||||
TAG: filtersByTag
|
TAG: filtersByTag
|
||||||
} = groupBy(filters, (filter) => {
|
} = groupBy(filters, ({ type }) => {
|
||||||
return filter.type;
|
return type;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (filtersByAccount?.length > 0) {
|
if (filtersByAccount?.length > 0) {
|
||||||
|
@ -312,10 +312,14 @@ export class OrderService {
|
|||||||
ACCOUNT: filtersByAccount,
|
ACCOUNT: filtersByAccount,
|
||||||
ASSET_CLASS: filtersByAssetClass,
|
ASSET_CLASS: filtersByAssetClass,
|
||||||
TAG: filtersByTag
|
TAG: filtersByTag
|
||||||
} = groupBy(filters, (filter) => {
|
} = groupBy(filters, ({ type }) => {
|
||||||
return filter.type;
|
return type;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const searchQuery = filters?.find(({ type }) => {
|
||||||
|
return type === 'SEARCH_QUERY';
|
||||||
|
})?.id;
|
||||||
|
|
||||||
if (filtersByAccount?.length > 0) {
|
if (filtersByAccount?.length > 0) {
|
||||||
where.accountId = {
|
where.accountId = {
|
||||||
in: filtersByAccount.map(({ id }) => {
|
in: filtersByAccount.map(({ id }) => {
|
||||||
@ -357,6 +361,30 @@ export class OrderService {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (searchQuery) {
|
||||||
|
const searchQueryWhereInput: Prisma.SymbolProfileWhereInput[] = [
|
||||||
|
{ id: { mode: 'insensitive', startsWith: searchQuery } },
|
||||||
|
{ isin: { mode: 'insensitive', startsWith: searchQuery } },
|
||||||
|
{ name: { mode: 'insensitive', startsWith: searchQuery } },
|
||||||
|
{ symbol: { mode: 'insensitive', startsWith: searchQuery } }
|
||||||
|
];
|
||||||
|
|
||||||
|
if (where.SymbolProfile) {
|
||||||
|
where.SymbolProfile = {
|
||||||
|
AND: [
|
||||||
|
where.SymbolProfile,
|
||||||
|
{
|
||||||
|
OR: searchQueryWhereInput
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
where.SymbolProfile = {
|
||||||
|
OR: searchQueryWhereInput
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (filtersByTag?.length > 0) {
|
if (filtersByTag?.length > 0) {
|
||||||
where.tags = {
|
where.tags = {
|
||||||
some: {
|
some: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user