Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT]: Endpoint to GET action activitiy_logs #1143

Open
4 of 9 tasks
Ayo-Oni-515 opened this issue Feb 28, 2025 · 1 comment
Open
4 of 9 tasks

[FEAT]: Endpoint to GET action activitiy_logs #1143

Ayo-Oni-515 opened this issue Feb 28, 2025 · 1 comment
Labels

Comments

@Ayo-Oni-515
Copy link
Contributor

Ayo-Oni-515 commented Feb 28, 2025

Description

Develop an endpoint to allow admin users to filter activity logs based on specific actions performed by users. Currently, the API does not support this feature. This implementation will enable admin users to troubleshoot issues related to specific actions more effectively.

Endpoint

Filter Activity Log by Action

  • Method: GET
  • URL: /api/v1/activity-logs?action="login"
  • Authorization: Admin-only access required.

Request Sample

GET /api/v1/activity-logs?action="login"
Authorization: Bearer <admin_token>

Response Sample

{
"status": "success",
"status_code": 200,
"message": "Action activity logs fetched successfully!",
"data": [
    {
        "action": "login",
        "user_id": "id",
        "timestamp": "2024-03-01T12:34:56Z"
    },
    {
        "action": "login",
        "user_id": "id",
        "timestamp": "2024-03-01T12:35:20Z"
    }
]       
}

Response Sample (Unauthorized Access)

{
    "status": "false",
    "status_code": 403,
    "message": "You do not have permission to access this resource"
}

Response Sample (Action Not Found)

{
    "status": "false",
    "status_code": 404,
    "message": "No logs found for the specified action."
}

Requirements

  • The endpoint should only be accessible to admin users only.

Motivation and Context

  • Enables easy troubleshooting.
  • Supports admin users to filter out specific actions performed by every user.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
@Ayo-Oni-515
Copy link
Contributor Author

Ayo-Oni-515 commented Mar 1, 2025

@joboy-dev @incredible-phoenix246 sirs please

@Ayo-Oni-515 Ayo-Oni-515 changed the title [FEAT]: Add endpoint to filter activitiy_logs based on actions [FEAT]: Endpoint to GET action activitiy_logs Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants