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
+3
View File
@@ -431,6 +431,7 @@ func PortalGetMiPerfil(c *fiber.Ctx) error {
"pais": full.Pais,
"documento": full.Documento,
"empresa": full.Empresa,
"sitio_web": full.SitioWeb,
"documento_rut_file": full.DocumentoRutFile,
"documento_rut_nombre": full.DocumentoRutNombre,
})
@@ -450,6 +451,7 @@ func PortalUpdateMiPerfil(c *fiber.Ctx) error {
Pais string `json:"pais"`
Documento string `json:"documento"`
Empresa string `json:"empresa"`
SitioWeb string `json:"sitio_web"`
}
var req Req
if err := c.BodyParser(&req); err != nil {
@@ -479,6 +481,7 @@ func PortalUpdateMiPerfil(c *fiber.Ctx) error {
full.Pais = req.Pais
full.Documento = req.Documento
full.Empresa = req.Empresa
full.SitioWeb = req.SitioWeb
if err := models.UpdatePortalUser(full); err != nil {
return c.Status(500).JSON(fiber.Map{"error": err.Error()})
}
@@ -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 {