Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/giangartun/Tis-GOAT-Frontend/llms.txt

Use this file to discover all available pages before exploring further.

The Users tab of the admin panel lets you view all registered users on the GOAT Portfolio platform, search by name or email address, filter by account status, and take moderation actions. A summary of total, active, and suspended user counts is displayed at the top of the tab.

User list

The user list is fetched from the following endpoint when the admin panel loads, and again whenever search or filter inputs change:
GET /api/admin/usuarios
Query parameters:
ParameterTypeDescription
searchstringFree-text search against user name and email
estadoactivo | suspendido | todosFilter by account status. Use todos or omit to return all users
pagenumberPage number for pagination (default: 1)
per_pagenumberNumber of results per page (default: 10)
Response shape:
{
  "total_usuarios": 150,
  "total_activos": 140,
  "total_suspendidos": 10,
  "current_page": 1,
  "last_page": 15,
  "total": 150,
  "data_usuarios": [
    {
      "id_usuario": "01ABC...",
      "nombre": "Juan Pérez",
      "email": "juan@example.com",
      "foto": null,
      "rol": "usuario",
      "estado": "activo",
      "fecha_registro": "2024-01-15T10:00:00Z",
      "fecha_ult_acceso": "2024-06-01T08:30:00Z"
    }
  ]
}
Each row in the user table displays the user’s name, email, role badge, account status badge, registration date, and last access timestamp. Search uses a 400 ms debounce — the list refreshes automatically as you type without requiring a form submission.
Pagination controls appear at the bottom of the user table only when last_page > 1. The current page, total page count, and total user count are displayed alongside the Previous and Next navigation buttons.

Suspending a user

To suspend a user, click the Suspend button on their row in the user table. A confirmation modal will appear showing the user’s name and email before the action is committed. Once confirmed, the frontend calls:
POST /api/admin/usuarios/:id/suspender
The user’s row is immediately updated to reflect the suspendido status. Suspended user rows are visually highlighted in red in the table.
Suspended users receive an HTTP 403 Forbidden response on their next login attempt. Their account remains in the system but they are blocked from accessing the platform until reactivated.

Reactivating a user

To restore access for a suspended user, click the Reactivate button on their row. The same confirmation modal pattern applies. Once confirmed, the frontend calls:
POST /api/admin/usuarios/:id/reactivar
The user’s status reverts to activo and they can log in normally on their next attempt. Note that the Suspend and Reactivate buttons are mutually exclusive — only one is shown per row depending on the user’s current estado. Admin accounts do not show either action button.

Audit log (Bitácora)

Switch to the Audit Log tab to browse the full historical record of platform events. The log is fetched from:
GET /api/admin/bitacora
Filter parameters:
ParameterTypeDescription
tipostringAction type filter (see values below)
fecha_desdestringStart date for range filter (YYYY-MM-DD)
fecha_hastastringEnd date for range filter (YYYY-MM-DD)
id_usuariostringFilter to a specific user’s events
pagenumberPagination page number
Supported tipo filter values:
ValueDescription
todosAll action types (default)
suspenderAccount suspension events
reactivarAccount reactivation events
modificacionesProfile and content modification events
creacionAccount creation events
loginLogin events
logoutLogout events
Each log entry has the following shape:
{
  "id_registro": "01XYZ...",
  "id_usuario": "01ABC...",
  "nombre": "Juan Pérez",
  "email": "juan@example.com",
  "foto": null,
  "rol": "usuario",
  "estado_actual": "activo",
  "tipo_accion": "login",
  "contexto": null,
  "fecha_accion": "2024-06-01T08:30:00Z"
}
The contexto field is null for events with no additional metadata, or a Record<string, any> object containing details such as the IP address, device information, the database table affected, the action performed, the reason for an admin action, and the ID of the admin who executed it. Clicking View Details on any log row opens a modal that parses and displays these context fields in a structured format, with a raw JSON viewer also available. Date range inputs accept values between 2024-01-01 and 2030-12-31. Validation errors are shown inline if an invalid date is entered. After adjusting filters, click Apply to refresh the results.

Exporting the audit log as PDF

Both the Users tab and the Audit Log tab include an Export PDF button in the top-right area of the panel. Clicking this button triggers the browser’s native print dialog (window.print()), which can be used to save the current view as a PDF file. Only the data table itself is included in the printout — navigation elements, filter controls, and action buttons are hidden during printing via print-specific CSS.

Build docs developers (and LLMs) love