From 1b412f8b15933b22bf74b95d9a739476b7dc775c Mon Sep 17 00:00:00 2001 From: Pavel Date: Tue, 26 Nov 2024 16:14:59 +0500 Subject: [PATCH] fix(condo): DOMA-10752 fix assignee select search --- .../organization/utils/clientSchema/search.tsx | 12 +++++++----- apps/condo/pages/_app.tsx | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/condo/domains/organization/utils/clientSchema/search.tsx b/apps/condo/domains/organization/utils/clientSchema/search.tsx index 57541ffd225..f5c0575a53c 100644 --- a/apps/condo/domains/organization/utils/clientSchema/search.tsx +++ b/apps/condo/domains/organization/utils/clientSchema/search.tsx @@ -41,14 +41,15 @@ async function _search (client, query, variables) { export function searchEmployeeWithSpecializations (intl, organizationId, filter) { if (!organizationId) return - return async function (client, value, query = {}, first, skip) { + return async function (client, value, query = {}, first = 300, skip) { const where = { organization: { id: organizationId }, + name_contains_i: value, ...query, } - const { data, error } = await _search(client, GET_ALL_ORGANIZATION_EMPLOYEE_QUERY, { value, where, first, skip }) + const { data, error } = await _search(client, GET_ALL_ORGANIZATION_EMPLOYEE_QUERY, { where, first, skip }) - const employees = data.objs + const employees = data.objs.filter(Boolean) const { data: organizationEmployeeSpecializations, @@ -73,12 +74,13 @@ export function searchEmployeeWithSpecializations (intl, organizationId, filter) export function searchEmployeeUser (intl, organizationId, filter) { if (!organizationId) return - return async function (client, value, query = {}, first, skip) { + return async function (client, value, query = {}, first = 300, skip) { const where = { organization: { id: organizationId }, + name_contains_i: value, ...query, } - const { data, error } = await _search(client, GET_ALL_ORGANIZATION_EMPLOYEE_QUERY, { value, where, first, skip }) + const { data, error } = await _search(client, GET_ALL_ORGANIZATION_EMPLOYEE_QUERY, { where, first, skip }) const employees = data.objs diff --git a/apps/condo/pages/_app.tsx b/apps/condo/pages/_app.tsx index d67e385f6b5..e23c22b77f8 100644 --- a/apps/condo/pages/_app.tsx +++ b/apps/condo/pages/_app.tsx @@ -441,7 +441,7 @@ const TasksProvider = ({ children }) => { }), [MiniAppTaskUIInterface, TicketDocumentGenerationTaskUIInterface, TicketExportTaskUIInterface, IncidentExportTaskUIInterface, ContactExportTaskUIInterface, BankSyncTaskUIInterface, BankReportTaskUIInterface, NewsItemRecipientsExportTaskUIInterface, MeterReadingsImportTaskUIInterface, MeterReadingExportTaskUIInterface]) const isInitialLoading = - !! user?.id + !user?.id || (isProcessingTasksLoading || !data) || isMiniAppTasksLoading