hngprojects / hng_boilerplate_nestjs

Description
Apache License 2.0
182 stars 105 forks source link

[FEAT] Develop API Endpoints for Notification Settings (GET) - Backend #214

Closed Benson-Ogheneochuko closed 2 weeks ago

Benson-Ogheneochuko commented 1 month ago

Description

Develop server-side logic to retrieve current notification settings.

Acceptance Criteria

Purpose

Provide a backend service that allows users to retrieve their notification preferences securely.

Requirements

Expected Outcome

Status Codes

Endpoint

[GET] /api/v1/settings/notification-settings

Request:

Headers:

{
  "Content-Type": "application/json",
  "Authorization": "Bearer <JWT_TOKEN>"
}

Path Parameters:

{
  "userId": "String"
}

Responses:

Successful response

{
  "message": "string",
  "success": true,
  "status_code": 200,
  "data": {
    // JSON object containing user notification settings key - value pairs
  }
}

## Example User Settings
{
  "email": false,
  "push-notification": true
}

Error response

{
  "message": "string",
  "success": false,
  "status_code": int
}

Testing

Write unit tests that cover

markessien commented 1 month ago

How are you using post for getting?

Benson-Ogheneochuko commented 1 month ago

@markessien Thank you for pointing that out, I have corrected it to use GET now.