Skip to content
Merged
Changes from all commits
Commits
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
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 : ""}`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mario-nt isn't the param name searchQuery wrong?

In the Index PR I've just merged the param name is search https://github.com/torrust/torrust-index/blob/develop/src/services/torrent.rs#L65?

{
"Authorization": `Bearer ${this.client.authToken}`,
"Content-Type": "application/json"
Expand Down
Loading