Skip to content

Commit

Permalink
fix(condo): DOMA-10752 fix assignee select search
Browse files Browse the repository at this point in the history
  • Loading branch information
nomerdvadcatpyat committed Nov 26, 2024
1 parent fa35a55 commit 1b412f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions apps/condo/domains/organization/utils/clientSchema/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion apps/condo/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1b412f8

Please sign in to comment.