Skip to content

Commit d1c7a0b

Browse files
committed
feat: [#51] added search param to get user profiles function
1 parent 5019e24 commit d1c7a0b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/modes/rest/resources/user.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type NewUser = {
4545
type GetUserProfilesParams = {
4646
pageSize: number
4747
page: number
48+
searchQuery?: string
4849
}
4950

5051
type GetUserProfilesResponseData = {
@@ -129,7 +130,7 @@ export class UserResource implements IRestResource {
129130
}
130131
async getUserProfiles(params: GetUserProfilesParams): Promise<GetUserProfilesResponseData> {
131132
return await fetchGet<GetUserProfilesResponse>(
132-
`${this.client.apiBaseUrl}/users?page_size=${params.pageSize}&page=${params.page - 1}`,
133+
`${this.client.apiBaseUrl}/users?page_size=${params.pageSize}&page=${params.page - 1}${params.searchQuery ? "&search=" + params.searchQuery : ""}`,
133134
{
134135
"Authorization": `Bearer ${this.client.authToken}`,
135136
"Content-Type": "application/json"

0 commit comments

Comments
 (0)