Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added search param to get user profiles function #52

Conversation

mario-nt
Copy link
Contributor

@mario-nt mario-nt commented Jan 26, 2025

Resolves #51

@mario-nt mario-nt marked this pull request as ready for review January 26, 2025 12:36
@mario-nt mario-nt requested a review from josecelano January 26, 2025 12:36
@@ -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?

@josecelano
Copy link
Member

ACK d1c7a0b

@josecelano josecelano merged commit 20f9c9e into torrust:main Jan 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add searching option to listing user profiles endpoint
2 participants