mejora del portal

This commit is contained in:
Lizandro Guarnizo
2026-05-15 15:39:48 -05:00
parent d7fe292f05
commit 04fd456a4c
3 changed files with 14 additions and 1 deletions
+4 -1
View File
@@ -124,8 +124,11 @@ func GetAllProyectos(limit, offset int, search string) ([]Proyecto, int64, error
}
func GetProyectosByClienteIDs(clienteIDs []uint) ([]Proyecto, error) {
if len(clienteIDs) == 0 {
return []Proyecto{}, nil
}
var items []Proyecto
err := app.Http.Database.DB.Where("cliente_id IN ?", clienteIDs).Order("created_at DESC").Find(&items).Error
err := app.Http.Database.DB.Preload("Cliente").Where("cliente_id IN ?", clienteIDs).Order("created_at DESC").Find(&items).Error
return items, err
}