hngprojects / hng_boilerplate_python_fastapi_web

Apache License 2.0
153 stars 141 forks source link

[FEAT] - External Dynamic pages - Job Listings - Retrieve All Job Listings #47

Open donfortune opened 1 month ago

donfortune commented 1 month ago

Description

Implement a feature to retrieve all job listings from the database. This endpoint should provide a list of all job listings, supporting pagination to handle large datasets.

Acceptance Criteria

Retrieve All Job listings Endpoint [GET] /api/v1/jobs

Retrieve All Job listings:

Expected Outcome

The system should return a paginated list of all job listings, upon receiving a valid request.

Request

[GET] /api/v1/jobs?page=Int&size=Int

Successful Response

{
  "message": "Job listings retrieved successfully.",
  "data": [
    {
      "title": "String",
      "description": "String",
      "location": "String",
      "salary": "String",
      "job_type": "String",

    },

  ],
  "pagination": {
    "current_page": "Int",
    "total_pages": "Int",
    "page_size": "Int",
    "total_items": "Int"
  }
}

ErrorResponse

{
  "message": "Failed to retrieve job listings.",
  "error": "String",
  "status_code": "Int"
} 
donfortune commented 1 month ago

This Issue Links To The Approved Issue Here