Skip to content

Commit bad3735

Browse files
committed
[DEV-19743] Declare search param support to Contacts API
1 parent 3ac19d9 commit bad3735

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/endpoints/Contacts/Client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ export function createClient(api: DeferredJobsApiClient) {
2323
* List Contacts Exports with sorting, and pagination.
2424
*/
2525
async function list(options: ListOptions = {}): Promise<ListResponse> {
26-
const { limit, offset, sortOrder } = options;
26+
const { limit, offset, search, sortOrder } = options;
2727
const { contacts, pagination, sort } = await api.get<{
2828
contacts: Contact[];
2929
pagination: Pagination;
3030
sort: string;
3131
}>(routing.contactsUrl, {
3232
query: {
33+
search,
3334
limit,
3435
offset,
3536
sort: SortOrder.stringify(sortOrder),
@@ -43,7 +44,7 @@ export function createClient(api: DeferredJobsApiClient) {
4344
* List Contacts Exports with sorting, pagination, and filtering.
4445
*/
4546
async function search(options: SearchOptions = {}): Promise<SearchResponse> {
46-
const { limit, offset, query, sortOrder } = options;
47+
const { limit, offset, query, search, sortOrder } = options;
4748
const url = `${routing.contactsUrl}/search`;
4849
const { contacts, pagination, sort } = await api.post<{
4950
contacts: Contact[];
@@ -53,6 +54,7 @@ export function createClient(api: DeferredJobsApiClient) {
5354
payload: {
5455
limit,
5556
offset,
57+
search,
5658
sort: SortOrder.stringify(sortOrder),
5759
query,
5860
},

src/endpoints/Contacts/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export type { ContactsBulkSelector as BulkSelector, ContactsScope as Scope } fro
77
export interface ListOptions {
88
limit?: number;
99
offset?: number;
10+
search?: string;
1011
sortOrder?: SortOrder | string;
1112
}
1213

0 commit comments

Comments
 (0)