Skip to content

Commit

Permalink
Merge pull request #173 from UniqueNetwork/feature/SCAN-fix-attribute…
Browse files Browse the repository at this point in the history
…s-filter

andWhere
  • Loading branch information
AzgatG committed Nov 30, 2022
2 parents 46502fe + ddf0d19 commit c57cf45
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/web-api/src/tokens/token.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,12 @@ export class TokenService extends BaseService<Tokens, TokenDTO> {

if (typeof rawValueParsed === 'object') {
// Text field in format {_: "value"}
qb.orWhere(`attributes->'${key}'->'rawValue'='${rawValue}'::jsonb`);
qb.andWhere(
`attributes->'${key}'->'rawValue'='${rawValue}'::jsonb`,
);
} else {
// Select and multiselect field
qb.orWhere(
qb.andWhere(
new Brackets((qb) => {
qb.where(
`attributes->'${key}'->>'rawValue'='${String(rawValue)}'`,
Expand Down

0 comments on commit c57cf45

Please sign in to comment.