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: list products #95

Closed
wants to merge 4 commits into from
Closed

feat: list products #95

wants to merge 4 commits into from

Conversation

Ibrahim4Grace
Copy link
Contributor

Description

This pull request implements an API endpoint to list products with pagination support. The endpoint returns basic information about each product, including the product name, price, and category.

Changes

  • Added an endpoint /api/v1/products to list products.
  • Implemented pagination support with page and limit parameters.
  • The response includes product details and pagination information.
  • Added error handling for invalid query parameters.
  • Wrote unit and integration tests for the endpoint.

Example Request

GET /api/v1/products?page=1&limit=10

Expected Response

{
  "success": true,
  "message": "Products retrieved successfully",
  "products": [
    {
      "name": "Product 1",
      "price": 29.99,
      "category": "Electronics"
    },
    {
      "name": "Product 2",
      "price": 19.99,
      "category": "Books"
    }
  ],
  "pagination": {
    "totalItems": 100,
    "totalPages": 10,
    "currentPage": 1
  },
  "status_code": 200
}

@Ibrahim4Grace Ibrahim4Grace deleted the 39-products_list branch July 22, 2024 11:14
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.

1 participant