hngprojects / hng_boilerplate_nestjs

Description
Apache License 2.0
182 stars 105 forks source link

[FEAT] HELP CENTER - UPDATE TOPIC #121

Closed elizase405 closed 2 weeks ago

elizase405 commented 1 month ago

Description

Backend logic to handle topic Updating (Admin only)

Acceptance Criteria

Purpose

Endpoint to allow superadmin to update existing topic

Requirements

Expected Outcome

EndPoint

PATCH /api/v1/help-center/topics/:id

Authentication Required: Yes (JWT Token)

Authorization Required: Yes (Admin Role)

Headers:

Request:

  {
    "title": "string",
    "content": "string",
    "author": "string"
  }

Response:

Table name: articles_table

_articleid:

title:

content:

createdAt:

updatedAt:

Testing

  1. Unit Tests
    • The return data for the /api/v1/help-center/topics/:id matches the documentation.
    • Ensure that Only authorized individuals can update a topic
    • Validate user input data
    • On success, data is updated in the database
elizase405 commented 1 month ago

As requested by Mark here, this article has been separated to this functionality.

elizase405 commented 1 month ago

As requested, Naming has been reviewed to a consistent format of 'topic'

CFCIfe commented 1 month ago

Please take note and update your route

https://github.com/hngprojects/hng_boilerplate_nestjs/issues/111#issuecomment-2235907567

mufidat3250 commented 1 month ago

Hi pls update the testing route too

CollinDex commented 1 month ago

Testing route updated as requested