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

feat(blog):add dynamic sorting, filtering, and pagination to blog retrieval #1221

Open
Karadumk opened this issue Mar 2, 2025 · 0 comments
Labels

Comments

@Karadumk
Copy link

Karadumk commented Mar 2, 2025

Issue Overview
The current blog retrieval endpoint lacks flexibility in sorting, filtering, and pagination, making it challenging for users to navigate and query blog posts effectively. This issue proposes implementing dynamic query capabilities to improve the user experience and API usability.

Problem Statement
1️⃣ Limited Querying Capabilities

The endpoint does not support dynamic sorting, making it difficult to order blog posts based on different attributes.
Filtering options are minimal, reducing the ability to retrieve relevant blog posts efficiently.
2️⃣ Lack of Pagination

Without pagination, retrieving large sets of blog posts can lead to inefficient data transfers and slow responses.
3️⃣ Validation Concerns

Sorting parameters are not validated, leading to potential errors when users provide invalid column names.

Proposed Solution
Dynamic Sorting: Allow users to specify the sorting field and order (ascending/descending).
Flexible Filtering: Enable filtering based on attributes like category, author, or date.
Efficient Pagination: Implement page-based or offset-based pagination to optimize data retrieval.
Validation Mechanism: Ensure that sort_by parameters match valid database columns to prevent errors.
Enhanced Response Metadata: Include total_count and pagination details in responses to support frontend development.

Expected Outcomes
✔️ Improved flexibility for querying blog posts.
✔️ More efficient API responses with pagination.
✔️ Enhanced user experience through structured sorting and filtering.
✔️ Better API reliability with validation safeguards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants