List credentials from db
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
9c1ffe8c20
commit
4610f83209
4 changed files with 20 additions and 14 deletions
|
|
@ -102,7 +102,11 @@ func (s *sqlDatabase) GetEnterpriseByID(ctx context.Context, enterpriseID string
|
|||
|
||||
func (s *sqlDatabase) ListEnterprises(_ context.Context) ([]params.Enterprise, error) {
|
||||
var enterprises []Enterprise
|
||||
q := s.conn.Preload("Credentials").Preload("Credentials.Endpoint").Find(&enterprises)
|
||||
q := s.conn.
|
||||
Preload("Credentials").
|
||||
Preload("Credentials.Endpoint").
|
||||
Preload("Endpoint").
|
||||
Find(&enterprises)
|
||||
if q.Error != nil {
|
||||
return []params.Enterprise{}, errors.Wrap(q.Error, "fetching enterprises")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue