Skip to content

Commit

Permalink
Merge #52: Added search param to get user profiles function
Browse files Browse the repository at this point in the history
d1c7a0b feat: [#51] added search param to get user profiles function (Mario)

Pull request description:

  Resolves #51

ACKs for top commit:
  josecelano:
    ACK d1c7a0b

Tree-SHA512: bfc818e6835e75683ba798ea49e81f5c6df1917e6b2fb5cab8b8a17d10f38a30f15c672bd545dbd03a03548ff84eff672f0100c25b68391fd251abe92707f365
  • Loading branch information
josecelano committed Jan 29, 2025
2 parents 5019e24 + d1c7a0b commit 20f9c9e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modes/rest/resources/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type NewUser = {
type GetUserProfilesParams = {
pageSize: number
page: number
searchQuery?: string
}

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

0 comments on commit 20f9c9e

Please sign in to comment.