hngprojects / hng_boilerplate_nestjs

Description
Apache License 2.0
182 stars 105 forks source link

[FEAT] Blog Post Listing Endpoint - Backend #94

Closed Pythonian closed 2 weeks ago

Pythonian commented 1 month ago

Description

Develop an endpoint to handle requests to fetch and return all blog post data. If the data is fetched successfully, it will be returned to the client with a 200 OK status. If an error occurs, an appropriate error status will be returned.

Acceptance Criteria

Requirements

Expected Outcome

Endpoints

[GET] /api/v1/blogs

Testing

Test Scenarios

  1. Successful Retrieval of Paginated Blog Posts

    • Ensure that the endpoint successfully retrieves a paginated list of blog posts.
    • Verify that the response includes the total count, next and previous page URLs, and the results with title, excerpt, publish date, and author for each blog post.
    • Confirm that the status code is 200 OK.
    • Confirm that the blog posts are ordered by the created date in descending order.
  2. No Blog Posts Present

    • Simulate a scenario where no blog posts are present in the database.
    • Confirm that the response body contains an empty list.
  3. Internal Server Error

    • Simulate an internal server error to raise an exception.
    • Verify that the endpoint returns a 500 Internal Server Error status code.
    • Confirm that the response body contains an appropriate error message.
  4. Invalid Page or Page Size Parameters

    • Send requests with invalid page or page_size parameters (e.g., negative numbers, non-integer values).
    • Verify that the endpoint returns a 400 Bad Request status code and an appropriate error message.
  5. Invalid Method

    • Send a request using an invalid HTTP method (e.g., POST) to the endpoint.
    • Verify that the endpoint returns a 405 Method Not Allowed status code.
  6. Soft-Deleted Blog Post Access Control

    • Ensure that soft-deleted blog posts are filtered out for users.
Pythonian commented 1 month ago

Hi @buka4rill @markessien

There is an issue here. I created this ticket which got first approval, and while still trying to raise a complete team of 6, someone who successfully did has now gone to get this assigned to himself.

How do i proceed now?

Pythonian commented 1 month ago
S/N Slack Name Github Username
1 Sapagrammer Pythonian Python
2 Salem thectogeneral Nestjs
3 Anetor Oselumese bahdman .NET
4 Synth thegirlSynth Go
buka4rill commented 1 month ago

@Pythonian include their github usernames

Pythonian commented 1 month ago

@Pythonian include their github usernames

@buka4rill I have updated it, but the third guy hasn't responded since I asked him for his. So whenever he responds, i will update it with his github username.

https://github.com/hngprojects/hng_boilerplate_nestjs/issues/94#issuecomment-2233630997