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

Add API query parameters to customize paginations #294

Closed
Creling opened this issue Jul 1, 2021 · 2 comments · Fixed by #324
Closed

Add API query parameters to customize paginations #294

Creling opened this issue Jul 1, 2021 · 2 comments · Fixed by #324
Labels
Enhancement Any requests for improvements or new features
Projects
Milestone

Comments

@Creling
Copy link

Creling commented Jul 1, 2021

Is your feature request related to a problem? Please describe.

It is another api request for the extension. :)

Currently, we do autocomplete depend on the /api/v1/search/*. Each time users type in a character will invoke a search requests which brings in notable latency.

image

Since the number of our tags is less than 500 most of the time, it is ok to fetch all tags (< 10KB) into local memory one time and match them with users' inputs. In that situation, we don't need another http request until the user submit the link which will mitigate the latency during autocomplete.

Yes, we could fetch all tags by /api/v1/tags, however, we need to access the api recursively due to the pagination, which is not efficient.

Describe the solution you'd like

/api/v1/search/lists & /api/v1/search/tags might be able to accept a * to return all tags/links.

@Creling Creling added the Enhancement Any requests for improvements or new features label Jul 1, 2021
@Kovah
Copy link
Owner

Kovah commented Jul 1, 2021

That's a great idea. Will plan this for one of the next versions. 👍

@Kovah Kovah added this to Backlog in Development via automation Jul 1, 2021
@Kovah Kovah changed the title [Feature Requeast] An Api that get all tags/links with least extra information Add API query parameters to customize paginations Jul 1, 2021
@Kovah Kovah added this to the v1.8 milestone Jan 5, 2022
@Kovah Kovah moved this from Backlog to In Progress in Development Jan 5, 2022
@Kovah
Copy link
Owner

Kovah commented Jan 5, 2022

Linkace will accept a per_page query parameter which can be used to control how many items will be returned. Set it to 0 and all results will be returned. Any other number > 0 will limit the returned items to that amount.

Example: http://linkace.localhost/api/v1/links?per_page=0

@Kovah Kovah moved this from In Progress to Release Queue in Development Jan 5, 2022
@Kovah Kovah linked a pull request Jan 5, 2022 that will close this issue
@Kovah Kovah closed this as completed in #324 Jan 6, 2022
Development automation moved this from Release Queue to Released Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Any requests for improvements or new features
Projects
Development
  
Released
Development

Successfully merging a pull request may close this issue.

2 participants