UBERF-4216: fix query for cases with mixins (#3981)

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
Vyacheslav Tumanov 2023-11-15 09:17:37 +05:00 committed by GitHub
parent 49e8bacce7
commit 64ae21db07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,18 +60,18 @@
}
values.clear()
realValues.clear()
const resultQuery =
isSearchable && search !== ''
? {
[filter.key.key]: { $like: '%' + search + '%' }
}
: {}
let prefix = ''
const hierarchy = client.getHierarchy()
const attr = hierarchy.getAttribute(filter.key._class, filter.key.key)
if (hierarchy.isMixin(attr.attributeOf)) {
prefix = attr.attributeOf + '.'
}
const resultQuery =
isSearchable && search !== ''
? {
[prefix + filter.key.key]: { $like: '%' + search + '%' }
}
: {}
const isDerivedFromSpace = hierarchy.isDerived(_class, core.class.Space)
const spaces =