feat: pagina principal configurable por rol (HomeUrl)
This commit is contained in:
@@ -13,6 +13,7 @@ type Roles struct {
|
||||
CreatedAt time.Time `json:"created_at" gorm:"column:created_at"`
|
||||
Description string `json:"description" gorm:"column:description"`
|
||||
Name string `json:"name" gorm:"column:name"`
|
||||
HomeUrl string `json:"home_url" gorm:"column:home_url"`
|
||||
EsPortalCliente bool `json:"es_portal_cliente" gorm:"column:es_portal_cliente;default:false"`
|
||||
EsPortalPartner bool `json:"es_portal_partner" gorm:"column:es_portal_partner;default:false"`
|
||||
Submodules []Submodules `json:"submodules" gorm:"many2many:roles_submodules"`
|
||||
|
||||
+1
-2
@@ -190,8 +190,7 @@ func GetUserByUsuario(usuario string) (*Users, error) {
|
||||
var user Users
|
||||
fmt.Println(usuario) // Verifica el usuario recibido
|
||||
db := app.Http.Database.DB.Model(&Users{})
|
||||
// Usamos 1 explícitamente para indicar que el estado debe ser "activo"
|
||||
if err := db.Where("nombre_usuario = ? AND email_verified = ? AND estado = ?", usuario, true, true).First(&user).Error; err != nil {
|
||||
if err := db.Where("nombre_usuario = ? AND email_verified = ? AND estado = ?", usuario, true, true).Preload("Role").First(&user).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user