This commit is contained in:
Lizandro Guarnizo
2026-05-19 12:43:19 -05:00
parent 7f309186d6
commit d713dcd47b
5 changed files with 176 additions and 45 deletions
@@ -51,6 +51,7 @@ func CreatePortalUsuario(c *fiber.Ctx) error {
Rol string `json:"rol"`
Notas string `json:"notas"`
TelegramChatID string `json:"telegram_chat_id"`
SitioWeb string `json:"sitio_web"`
}
var req Req
if err := c.BodyParser(&req); err != nil {
@@ -86,6 +87,7 @@ func CreatePortalUsuario(c *fiber.Ctx) error {
Activo: true,
Notas: req.Notas,
TelegramChatID: req.TelegramChatID,
SitioWeb: req.SitioWeb,
}
if err := models.CreatePortalUser(u); err != nil {
return c.Status(500).JSON(fiber.Map{"error": err.Error()})
@@ -109,6 +111,7 @@ func UpdatePortalUsuario(c *fiber.Ctx) error {
Activo bool `json:"activo"`
Notas string `json:"notas"`
TelegramChatID string `json:"telegram_chat_id"`
SitioWeb string `json:"sitio_web"`
}
var req Req
if err := c.BodyParser(&req); err != nil {
@@ -133,6 +136,7 @@ func UpdatePortalUsuario(c *fiber.Ctx) error {
Activo: req.Activo,
Notas: req.Notas,
TelegramChatID: req.TelegramChatID,
SitioWeb: req.SitioWeb,
}
u.ID = uint(id)
if err := models.UpdatePortalUser(u); err != nil {