/api/modulo/:id
Permanently removes a module and cascades the deletion to all related records. The endpoint deletes in this order:
- All
permisos_perfilrows whereidModulomatches the givenid. - All
menurows whereidModulomatches the givenid. - The
modulorecord itself.
Path parameters
Primary key of the module to delete.
Response
true when the module and all related records are deleted successfully.Confirmation string. Always
"Módulo y sus permisos asociados eliminados correctamente." on success.Error responses
| Status | Message | Cause |
|---|---|---|
200 (with success: false) | ID de módulo inválido. | The :id path segment is missing or resolves to 0 or NaN. |
200 (with success: false) | Ocurrió un error al intentar eliminar el módulo. | Any unhandled database error during the delete sequence. |
Errors for this endpoint return HTTP
200 with success: false in the body rather than a 4xx/5xx HTTP status code.Examples
Success response
200
Error response (invalid ID)
200