hngprojects / hng_boilerplate_csharp_web

https://api-csharp.boilerplate.hng.tech
Apache License 2.0
78 stars 42 forks source link

feat(organization): Get all organization users #314

Closed Reliable25 closed 2 months ago

Reliable25 commented 2 months ago

Description

This PR introduces an endpoint for retrieving all users within a specific organization for authenticated users. This endpoint allows fetching user details associated with a given organization ID. Features Implemented:

Closes #issue_number_here

Changes proposed

Get All Users in Organisation

Endpoint: GET /api/v1/organizations/{orgId}/users Summary: Retrieve all users associated with a specific organization.

Path Parameter:

Successful Response: Status Code: 200 OK Response:

{
  "status_code": 200,
  "data": {
    "users": [
      {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "firstName": "John",
        "lastName": "Doe",
        "email": "john.doe@example.com",
        "phoneNumber": "1234567890",
        "avatarUrl": "https://example.com/avatar.jpg",
        "createdAt": "2024-08-15T12:00:00Z",
        "updatedAt": "2024-08-15T12:00:00Z"
      },
      // Additional users...
    ]
  }
}

Error Responses: Not Found: Status Code: 404 Not Found Response:

{
  "status_code": 404,
  "message": "Organization not found"
}

What were you told to do?

Implement an endpoint for retrieving all users within a specific organization.

What did you do?

🚨Please review the contribution guideline for this repository.

Screenshots/Videos