hngprojects / hng_boilerplate_python_fastapi_web

Apache License 2.0
155 stars 136 forks source link

API to fetch single testimonial #68

Open FreemanBoss opened 3 months ago

FreemanBoss commented 3 months ago

Description

Fetch a single testimonial by Id.

Acceptance Criteria

Purpose

Be able to view a single testimonial and leave a comment.

Requirements

API Endpoint

GET /api/v1/testimonials/: testimonial_id

Response

{
  "message": "Testimonial fetched successfully",
  "status_code": 200,
  "data": {
    "id": "String",
    "author": "String",
    "testimonial": "String",
    "comments": Array, 
    "created_at": "DateTime",
  }
}

Error Responses

{
  "status_code": 404,
  "message": "Testimonial not found"
}
{
  "status_code": 401,
  "message": "Unauthorized "
}

Expected Outcome

User should be able to view Single Testimonial and all the comments associated with it.

Tasks

Testing

FreemanBoss commented 3 months ago

Reference ticket: hngprojects/hng_boilerplate_nestjs#255 Slack id: - Habeeb Babasulaiman