Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
069754e
chore: Add SearchForUsersParams type and integrate into API parameters
fedirjh Dec 31, 2025
a38c7ba
feat: Implement searchUserInServer function and update related API calls
fedirjh Dec 31, 2025
82e0633
feat: Replace searchInServer with searchUserInServer across multiple …
fedirjh Dec 31, 2025
5525f4e
Merge remote-tracking branch 'upstream' into add-SearchForUsers-command
fedirjh Dec 31, 2025
623ef4f
feat: Refactor search functions to unify server search logic and impr…
fedirjh Dec 31, 2025
e1354e2
fix: Style formatting
fedirjh Dec 31, 2025
9829c12
Merge branch 'Expensify:main' into add-SearchForUsers-command
fedirjh Jan 12, 2026
adfda30
Merge remote-tracking branch 'upstream' into add-SearchForUsers-command
fedirjh Feb 17, 2026
b2ac0c9
Merge branch 'Expensify:main' into add-SearchForUsers-command
fedirjh Feb 18, 2026
f32726f
Merge branch 'Expensify:main' into add-SearchForUsers-command
fedirjh Feb 19, 2026
9c6e774
Merge branch 'Expensify:main' into add-SearchForUsers-command
fedirjh Feb 20, 2026
b3864d0
chore: Refactor pending request cancellation to use SEARCH_FOR_USERS …
fedirjh Feb 20, 2026
79e91d3
refactor: Simplify pending request cancellation logic in searchForRep…
fedirjh Feb 20, 2026
d8e60a5
Merge branch 'main' into add-SearchForUsers-command
fedirjh Feb 24, 2026
400d3bf
Merge branch 'main' into add-SearchForUsers-command
fedirjh Feb 25, 2026
77f6b9f
chore: Refactor search functionality to use searchUserInServer in Bas…
fedirjh Feb 25, 2026
a8002f4
refactor: Simplify search command handling in Report actions by using…
fedirjh Feb 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/BaseVacationDelegateSelectionComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useSearchSelector from '@hooks/useSearchSelector';
import useThemeStyles from '@hooks/useThemeStyles';
import {searchInServer} from '@libs/actions/Report';
import {searchUserInServer} from '@libs/actions/Report';
import {formatPhoneNumber} from '@libs/LocalePhoneNumber';
import {getHeaderMessage} from '@libs/OptionsListUtils';
import {getPersonalDetailByEmail} from '@libs/PersonalDetailsUtils';
Expand Down Expand Up @@ -79,7 +79,7 @@ function BaseVacationDelegateSelectionComponent({
});

useEffect(() => {
searchInServer(debouncedSearchTerm);
searchUserInServer(debouncedSearchTerm);
}, [debouncedSearchTerm]);

const sectionsList = [];
Expand Down
6 changes: 6 additions & 0 deletions src/libs/API/parameters/SearchForUsersParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type SearchForUsersParams = {
searchInput: string;
canCancel?: boolean;
};

export default SearchForUsersParams;
1 change: 1 addition & 0 deletions src/libs/API/parameters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export type {default as ResolveActionableReportMentionWhisperParams} from './Res
export type {default as RevealExpensifyCardDetailsParams} from './RevealExpensifyCardDetailsParams';
export type {default as SearchForReportsParams} from './SearchForReportsParams';
export type {default as SearchForRoomsToMentionParams} from './SearchForRoomsToMentionParams';
export type {default as SearchForUsersParams} from './SearchForUsersParams';
export type {default as GraphiteParams} from './GraphiteParams';
export type {default as SetContactMethodAsDefaultParams} from './SetContactMethodAsDefaultParams';
export type {default as SignInUserWithLinkParams} from './SignInUserWithLinkParams';
Expand Down
2 changes: 2 additions & 0 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@ const READ_COMMANDS = {
OPEN_ROOM_MEMBERS_PAGE: 'OpenRoomMembersPage',
SEARCH_FOR_REPORTS: 'SearchForReports',
SEARCH_FOR_ROOMS_TO_MENTION: 'SearchForRoomsToMention',
SEARCH_FOR_USERS: 'SearchForUsers',
GRAPHITE: 'Graphite',
GET_ROUTE: 'GetRoute',
GET_ROUTE_FOR_DRAFT: 'GetRouteForDraft',
Expand Down Expand Up @@ -1258,6 +1259,7 @@ type ReadCommandParameters = {
[READ_COMMANDS.OPEN_ROOM_MEMBERS_PAGE]: Parameters.OpenRoomMembersPageParams;
[READ_COMMANDS.SEARCH_FOR_REPORTS]: Parameters.SearchForReportsParams;
[READ_COMMANDS.SEARCH_FOR_ROOMS_TO_MENTION]: Parameters.SearchForRoomsToMentionParams;
[READ_COMMANDS.SEARCH_FOR_USERS]: Parameters.SearchForUsersParams;
[READ_COMMANDS.GRAPHITE]: Parameters.GraphiteParams;
[READ_COMMANDS.GET_ROUTE]: Parameters.GetRouteParams;
[READ_COMMANDS.GET_ROUTE_FOR_DRAFT]: Parameters.GetRouteParams;
Expand Down
2 changes: 2 additions & 0 deletions src/libs/HttpUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ let shouldForceOffline = false;
const ABORT_COMMANDS = {
All: 'All',
[READ_COMMANDS.SEARCH_FOR_REPORTS]: READ_COMMANDS.SEARCH_FOR_REPORTS,
[READ_COMMANDS.SEARCH_FOR_USERS]: READ_COMMANDS.SEARCH_FOR_USERS,
} as const;

type AbortCommand = keyof typeof ABORT_COMMANDS;
Expand All @@ -39,6 +40,7 @@ Onyx.connectWithoutView({
const abortControllerMap = new Map<AbortCommand, AbortController>();
abortControllerMap.set(ABORT_COMMANDS.All, new AbortController());
abortControllerMap.set(ABORT_COMMANDS.SearchForReports, new AbortController());
abortControllerMap.set(ABORT_COMMANDS.SearchForUsers, new AbortController());

/**
* The API commands that require the skew calculation
Expand Down
23 changes: 17 additions & 6 deletions src/libs/actions/Report/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
ResolveActionableReportMentionWhisperParams,
SearchForReportsParams,
SearchForRoomsToMentionParams,
SearchForUsersParams,
TogglePinnedChatParams,
TransactionThreadInfo,
UpdateChatNameParams,
Expand Down Expand Up @@ -314,7 +315,7 @@
/** @deprecated This value is deprecated and will be removed soon after migration. Use the email from useCurrentUserPersonalDetails hook instead. */
let deprecatedCurrentUserLogin: string | undefined;

Onyx.connect({

Check warning on line 318 in src/libs/actions/Report/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
// When signed out, val is undefined
Expand All @@ -328,7 +329,7 @@
},
});

Onyx.connect({

Check warning on line 332 in src/libs/actions/Report/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.CONCIERGE_REPORT_ID,
callback: (value) => (conciergeReportIDOnyxConnect = value),
});
Expand All @@ -336,7 +337,7 @@
// map of reportID to all reportActions for that report
const allReportActions: OnyxCollection<ReportActions> = {};

Onyx.connect({

Check warning on line 340 in src/libs/actions/Report/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
callback: (actions, key) => {
if (!key || !actions) {
Expand All @@ -348,7 +349,7 @@
});

let allReports: OnyxCollection<Report>;
Onyx.connect({

Check warning on line 352 in src/libs/actions/Report/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -357,7 +358,7 @@
});

let allPersonalDetails: OnyxEntry<PersonalDetailsList> = {};
Onyx.connect({

Check warning on line 361 in src/libs/actions/Report/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
allPersonalDetails = value ?? {};
Expand All @@ -372,7 +373,7 @@
});

let onboarding: OnyxEntry<Onboarding>;
Onyx.connect({

Check warning on line 376 in src/libs/actions/Report/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.NVP_ONBOARDING,
callback: (val) => {
if (Array.isArray(val)) {
Expand All @@ -383,7 +384,7 @@
});

let deprecatedIntroSelected: OnyxEntry<IntroSelected> = {};
Onyx.connect({

Check warning on line 387 in src/libs/actions/Report/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.NVP_INTRO_SELECTED,
callback: (val) => (deprecatedIntroSelected = val),
});
Expand Down Expand Up @@ -4617,7 +4618,7 @@
Onyx.merge(`${ONYXKEYS.COLLECTION.PRIVATE_NOTES_DRAFT}${reportID}`, note);
}

function searchForReports(isOffline: boolean, searchInput: string, policyID?: string) {
function searchForReports(isOffline: boolean, searchInput: string, policyID?: string, isUserSearch = false) {
// We do not try to make this request while offline because it sets a loading indicator optimistically
if (isOffline) {
Onyx.set(ONYXKEYS.IS_SEARCHING_FOR_REPORTS, false);
Expand All @@ -4641,20 +4642,21 @@
];

const searchForRoomToMentionParams: SearchForRoomsToMentionParams = {query: searchInput.toLowerCase(), policyID};
const searchForReportsParams: SearchForReportsParams = {searchInput: searchInput.toLowerCase(), canCancel: true};
const searchForReportsOrUsersParams: SearchForReportsParams | SearchForUsersParams = {searchInput: searchInput.toLowerCase(), canCancel: true};
const searchInServerCommand = isUserSearch ? READ_COMMANDS.SEARCH_FOR_USERS : READ_COMMANDS.SEARCH_FOR_REPORTS;

// We want to cancel all pending SearchForReports API calls before making another one
if (!policyID) {
HttpUtils.cancelPendingRequests(READ_COMMANDS.SEARCH_FOR_REPORTS);
HttpUtils.cancelPendingRequests(searchInServerCommand);
}

API.read(policyID ? READ_COMMANDS.SEARCH_FOR_ROOMS_TO_MENTION : READ_COMMANDS.SEARCH_FOR_REPORTS, policyID ? searchForRoomToMentionParams : searchForReportsParams, {
API.read(policyID ? READ_COMMANDS.SEARCH_FOR_ROOMS_TO_MENTION : searchInServerCommand, policyID ? searchForRoomToMentionParams : searchForReportsOrUsersParams, {
successData,
failureData,
});
}

function searchInServer(searchInput: string, policyID?: string) {
function performServerSearch(searchInput: string, policyID?: string, isUserSearch = false) {
// We are not getting isOffline from components as useEffect change will re-trigger the search on network change
const isOffline = NetworkStore.isOffline();
if (isOffline || !searchInput.trim().length) {
Expand All @@ -4666,7 +4668,15 @@
// we want to show the loading state right away. Otherwise, we will see a flashing UI where the client options are sorted and
// tell the user there are no options, then we start searching, and tell them there are no options again.
Onyx.set(ONYXKEYS.IS_SEARCHING_FOR_REPORTS, true);
searchForReports(isOffline, searchInput, policyID);
searchForReports(isOffline, searchInput, policyID, isUserSearch);
}

function searchInServer(searchInput: string, policyID?: string) {
performServerSearch(searchInput, policyID);
}

function searchUserInServer(searchInput: string) {
performServerSearch(searchInput, undefined, true);
}

function updateLastVisitTime(reportID: string) {
Expand Down Expand Up @@ -6718,6 +6728,7 @@
saveReportActionDraft,
saveReportDraftComment,
searchInServer,
searchUserInServer,
setDeleteTransactionNavigateBackUrl,
setGroupDraft,
setIsComposerFullSize,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/InviteReportParticipantsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useSearchSelector from '@hooks/useSearchSelector';
import useThemeStyles from '@hooks/useThemeStyles';
import {inviteToGroupChat, searchInServer} from '@libs/actions/Report';
import {inviteToGroupChat, searchUserInServer} from '@libs/actions/Report';
import {clearUserSearchPhrase, updateUserSearchPhrase} from '@libs/actions/RoomMembersUserSearchPhrase';
import {canUseTouchScreen} from '@libs/DeviceCapabilities';
import {appendCountryCode} from '@libs/LoginUtils';
Expand Down Expand Up @@ -66,7 +66,7 @@ function InviteReportParticipantsPage({report}: InviteReportParticipantsPageProp

useEffect(() => {
updateUserSearchPhrase(debouncedSearchTerm);
searchInServer(debouncedSearchTerm);
searchUserInServer(debouncedSearchTerm);
}, [debouncedSearchTerm]);

const sections: Sections = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useSearchSelector from '@hooks/useSearchSelector';
import useThemeStyles from '@hooks/useThemeStyles';
import {addMembersToWorkspace} from '@libs/actions/Policy/Member';
import {searchInServer} from '@libs/actions/Report';
import {searchUserInServer} from '@libs/actions/Report';
import {READ_COMMANDS} from '@libs/API/types';
import {canUseTouchScreen} from '@libs/DeviceCapabilities';
import HttpUtils from '@libs/HttpUtils';
Expand Down Expand Up @@ -85,7 +85,7 @@ function BaseOnboardingWorkspaceInvite({shouldUseNativeStyles}: BaseOnboardingWo
const welcomeNote = translate('workspace.common.welcomeNote');

useEffect(() => {
searchInServer(debouncedSearchTerm);
searchUserInServer(debouncedSearchTerm);
}, [debouncedSearchTerm]);

const sections: Sections = [];
Expand Down Expand Up @@ -155,7 +155,7 @@ function BaseOnboardingWorkspaceInvite({shouldUseNativeStyles}: BaseOnboardingWo
if (!isValid || !onboardingPolicyID) {
return;
}
HttpUtils.cancelPendingRequests(READ_COMMANDS.SEARCH_FOR_REPORTS);
HttpUtils.cancelPendingRequests(READ_COMMANDS.SEARCH_FOR_USERS);

const invitedEmailsToAccountIDs: InvitedEmailsToAccountIDs = {};
for (const option of selectedOptions) {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/RoomInvitePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useReportIsArchived from '@hooks/useReportIsArchived';
import useThemeStyles from '@hooks/useThemeStyles';
import {inviteToRoom, inviteToRoomAction, searchInServer} from '@libs/actions/Report';
import {inviteToRoom, inviteToRoomAction, searchUserInServer} from '@libs/actions/Report';
import {clearUserSearchPhrase, updateUserSearchPhrase} from '@libs/actions/RoomMembersUserSearchPhrase';
import {READ_COMMANDS} from '@libs/API/types';
import {canUseTouchScreen} from '@libs/DeviceCapabilities';
Expand Down Expand Up @@ -205,7 +205,7 @@ function RoomInvitePage({
const ancestors = useAncestors(report);

const inviteUsers = () => {
HttpUtils.cancelPendingRequests(READ_COMMANDS.SEARCH_FOR_REPORTS);
HttpUtils.cancelPendingRequests(READ_COMMANDS.SEARCH_FOR_USERS);

if (selectedOptions.length === 0) {
return;
Expand Down Expand Up @@ -251,7 +251,7 @@ function RoomInvitePage({

useEffect(() => {
updateUserSearchPhrase(debouncedSearchTerm);
searchInServer(debouncedSearchTerm);
searchUserInServer(debouncedSearchTerm);
Comment thread
fedirjh marked this conversation as resolved.
Resolved
}, [debouncedSearchTerm]);

let subtitleKey: '' | TranslationPaths | undefined;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/domain/Admins/DomainAddAdminPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useSearchSelector from '@hooks/useSearchSelector';
import useThemeStyles from '@hooks/useThemeStyles';
import {searchInServer} from '@libs/actions/Report';
import {searchUserInServer} from '@libs/actions/Report';
import {canUseTouchScreen} from '@libs/DeviceCapabilities';
import Navigation from '@libs/Navigation/Navigation';
import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types';
Expand Down Expand Up @@ -60,7 +60,7 @@ function DomainAddAdminPage({route}: DomainAddAdminProps) {
});

useEffect(() => {
searchInServer(debouncedSearchTerm);
searchUserInServer(debouncedSearchTerm);
}, [debouncedSearchTerm]);

const inviteUser = () => {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/iou/request/MoneyRequestAccountantSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
orderOptions,
} from '@libs/OptionsListUtils';
import type {SelectionListSections} from '@libs/OptionsListUtils/types';
import {searchInServer} from '@userActions/Report';
import {searchUserInServer} from '@userActions/Report';
import type {IOUAction, IOUType} from '@src/CONST';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
Expand Down Expand Up @@ -73,7 +73,7 @@ function MoneyRequestAccountantSelector({onFinish, onAccountantSelected, iouType
const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);

useEffect(() => {
searchInServer(debouncedSearchTerm.trim());
searchUserInServer(debouncedSearchTerm.trim());
}, [debouncedSearchTerm]);

const defaultOptions = useMemo(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/iou/request/MoneyRequestAttendeeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import useScreenWrapperTransitionStatus from '@hooks/useScreenWrapperTransitionS
import useSearchSelector from '@hooks/useSearchSelector';
import useThemeStyles from '@hooks/useThemeStyles';
import useUserToInviteReports from '@hooks/useUserToInviteReports';
import {searchInServer} from '@libs/actions/Report';
import {searchUserInServer} from '@libs/actions/Report';
import {canUseTouchScreen} from '@libs/DeviceCapabilities';
import {
formatSectionsFromSearchTerm,
Expand Down Expand Up @@ -124,7 +124,7 @@ function MoneyRequestAttendeeSelector({attendees = [], onFinish, onAttendeesAdde
});

useEffect(() => {
searchInServer(debouncedSearchTerm.trim());
searchUserInServer(debouncedSearchTerm.trim());
}, [debouncedSearchTerm]);

let orderedAvailableOptions;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/iou/request/MoneyRequestParticipantsSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import type {OptionData} from '@libs/ReportUtils';
import {isInvoiceRoom} from '@libs/ReportUtils';
import {shouldRestrictUserBillableActions} from '@libs/SubscriptionUtils';
import {getInvoicePrimaryWorkspace} from '@userActions/Policy/Policy';
import {searchInServer} from '@userActions/Report';
import {searchUserInServer} from '@userActions/Report';
import type {IOUAction, IOUType} from '@src/CONST';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
Expand Down Expand Up @@ -243,7 +243,7 @@ function MoneyRequestParticipantsSelector({
const {userToInviteExpenseReport, userToInviteChatReport} = useUserToInviteReports(availableOptions?.userToInvite);

useEffect(() => {
searchInServer(debouncedSearchTerm.trim());
searchUserInServer(debouncedSearchTerm.trim());
}, [debouncedSearchTerm]);

const inputHelperText = useMemo(
Expand Down
4 changes: 2 additions & 2 deletions src/pages/settings/Security/AddDelegate/AddDelegatePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useSearchSelector from '@hooks/useSearchSelector';
import useThemeStyles from '@hooks/useThemeStyles';
import {searchInServer} from '@libs/actions/Report';
import {searchUserInServer} from '@libs/actions/Report';
import Navigation from '@libs/Navigation/Navigation';
import {getHeaderMessage} from '@libs/OptionsListUtils';
import CONST from '@src/CONST';
Expand Down Expand Up @@ -85,7 +85,7 @@ function AddDelegatePage() {
}));

useEffect(() => {
searchInServer(debouncedSearchTerm);
searchUserInServer(debouncedSearchTerm);
}, [debouncedSearchTerm]);

return (
Expand Down
6 changes: 3 additions & 3 deletions src/pages/tasks/TaskAssigneeSelectorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import useOnyx from '@hooks/useOnyx';
import useReportIsArchived from '@hooks/useReportIsArchived';
import useSearchSelector from '@hooks/useSearchSelector';
import useThemeStyles from '@hooks/useThemeStyles';
import {searchInServer} from '@libs/actions/Report';
import {searchUserInServer} from '@libs/actions/Report';
import {canModifyTask, editTaskAssignee, setAssigneeValue} from '@libs/actions/Task';
import {READ_COMMANDS} from '@libs/API/types';
import HttpUtils from '@libs/HttpUtils';
Expand Down Expand Up @@ -143,7 +143,7 @@ function TaskAssigneeSelectorModal() {
const initiallyFocusedOptionKey = sections.flatMap((section) => section.data).find((mode) => mode.isSelected === true)?.keyForList;

const selectReport = (option: ListItem) => {
HttpUtils.cancelPendingRequests(READ_COMMANDS.SEARCH_FOR_REPORTS);
HttpUtils.cancelPendingRequests(READ_COMMANDS.SEARCH_FOR_USERS);
if (!option) {
return;
}
Expand Down Expand Up @@ -205,7 +205,7 @@ function TaskAssigneeSelectorModal() {
const isTaskNonEditable = isTaskReport(report) && (!isTaskModifiable || !isOpen);

useEffect(() => {
searchInServer(debouncedSearchTerm);
searchUserInServer(debouncedSearchTerm);
}, [debouncedSearchTerm]);

const textInputOptions = {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/workspace/WorkspaceInvitePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import useSearchSelector from '@hooks/useSearchSelector';
import useThemeStyles from '@hooks/useThemeStyles';
import {setWorkspaceInviteMembersDraft} from '@libs/actions/Policy/Member';
import {clearErrors, openWorkspaceInvitePage as policyOpenWorkspaceInvitePage, setWorkspaceErrors} from '@libs/actions/Policy/Policy';
import {searchInServer} from '@libs/actions/Report';
import {searchUserInServer} from '@libs/actions/Report';
import {READ_COMMANDS} from '@libs/API/types';
import {canUseTouchScreen} from '@libs/DeviceCapabilities';
import HttpUtils from '@libs/HttpUtils';
Expand Down Expand Up @@ -175,7 +175,7 @@ function WorkspaceInvitePage({route, policy}: WorkspaceInvitePageProps) {
if (!isValid) {
return;
}
HttpUtils.cancelPendingRequests(READ_COMMANDS.SEARCH_FOR_REPORTS);
HttpUtils.cancelPendingRequests(READ_COMMANDS.SEARCH_FOR_USERS);

const invitedEmailsToAccountIDs: InvitedEmailsToAccountIDs = {};
for (const option of selectedOptions) {
Expand Down Expand Up @@ -235,7 +235,7 @@ function WorkspaceInvitePage({route, policy}: WorkspaceInvitePageProps) {
);

useEffect(() => {
searchInServer(debouncedSearchTerm);
searchUserInServer(debouncedSearchTerm);
}, [debouncedSearchTerm]);

const textInputOptions = useMemo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import usePolicy from '@hooks/usePolicy';
import useSearchSelector from '@hooks/useSearchSelector';
import useThemeStyles from '@hooks/useThemeStyles';
import {setDraftInviteAccountID} from '@libs/actions/Card';
import {searchInServer} from '@libs/actions/Report';
import {searchUserInServer} from '@libs/actions/Report';
import {getCardAssignmentDateOption, getCardAssignmentStartDate, getDefaultCardName} from '@libs/CardUtils';
import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types';
import type {SettingsNavigatorParamList} from '@libs/Navigation/types';
Expand Down Expand Up @@ -201,7 +201,7 @@ function AssigneeStep({route}: AssigneeStepProps) {
}

useEffect(() => {
searchInServer(debouncedSearchTerm);
searchUserInServer(debouncedSearchTerm);
}, [debouncedSearchTerm]);

const searchValue = debouncedSearchTerm.trim().toLowerCase();
Expand Down
4 changes: 2 additions & 2 deletions src/pages/workspace/expensifyCard/issueNew/AssigneeStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import useNetwork from '@hooks/useNetwork';
import useOnyx from '@hooks/useOnyx';
import useSearchSelector from '@hooks/useSearchSelector';
import useThemeStyles from '@hooks/useThemeStyles';
import {searchInServer} from '@libs/actions/Report';
import {searchUserInServer} from '@libs/actions/Report';
import type {PlatformStackRouteProp} from '@libs/Navigation/PlatformStackNavigation/types';
import type {SettingsNavigatorParamList} from '@libs/Navigation/types';
import {getHeaderMessage, getSearchValueForPhoneOrEmail, sortAlphabetically} from '@libs/OptionsListUtils';
Expand Down Expand Up @@ -172,7 +172,7 @@ function AssigneeStep({policy, stepNames, startStepIndex, route}: AssigneeStepPr
}

useEffect(() => {
searchInServer(debouncedSearchTerm);
searchUserInServer(debouncedSearchTerm);
}, [debouncedSearchTerm]);

const searchValue = debouncedSearchTerm.trim().toLowerCase();
Expand Down
Loading
Loading