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