forked from boramalper/magnetico
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web): add new parameters with different semantics to the `torren…
…tstotal` api A frontend interface was created using AI, and I initially implemented both "previous" and "next" pagination. However, I was unable to achieve the specific page navigation functionality I intended. After modifying the API, it now provides an approximate count of results (e.g., "Approximately xxx items found"). Pagination has been implemented using cursor-based pagination, which also improves the experience on mobile devices. At the time, I mistakenly thought it was possible to paginate by specifying a page number, without realizing that pagination could only be achieved using cursors. The functionality of this API has now been modified to return an approximate count of results that can be fetched. Two new parameters, **NewLogic** and **QueryType**, have been added. - **NewLogic** controls compatibility: when set to `true`, the response will use the new JSON format; when set to `false`, it will use the old response format. - **QueryType** enhances the API’s functionality to avoid issues arising from potential misunderstandings. Currently, it only supports total count queries by keyword, and it requires **NewLogic=true** to be effective. Compatibility with the old behaviour has been implemented.
- Loading branch information
Showing
2 changed files
with
137 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters