mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 21:50:34 +03:00
TSK-807: Query only active Employees (#2753)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
0688a4dd23
commit
acd3cf7276
@ -104,7 +104,8 @@ async function queryContact (
|
||||
search: string,
|
||||
filter?: { in?: RelatedDocument[], nin?: RelatedDocument[] }
|
||||
): Promise<ObjectSearchResult[]> {
|
||||
const q: DocumentQuery<Contact> = { name: { $like: `%${search}%` } }
|
||||
let q: DocumentQuery<Contact> = { name: { $like: `%${search}%` } }
|
||||
if (_class === contact.class.Employee) q = { ...q, active: true }
|
||||
if (filter?.in !== undefined || filter?.nin !== undefined) {
|
||||
q._id = {}
|
||||
if (filter.in !== undefined) {
|
||||
|
Loading…
Reference in New Issue
Block a user