add list secret api endpoint
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -63,9 +63,10 @@ func GetSecrets(s *Secret, adminRole bool) ([]Secret, error) {
|
||||
} else if s.DeviceCategory != "" {
|
||||
rows, err = db.Queryx("SELECT * FROM secrets WHERE DeviceCategory LIKE ?", s.DeviceCategory)
|
||||
} else {
|
||||
log.Printf("GetSecret no valid search options specified\n")
|
||||
err = errors.New("no valid search options specified")
|
||||
return secretResults, err
|
||||
rows, err = db.Queryx("SELECT * FROM secrets")
|
||||
//log.Printf("GetSecret no valid search options specified\n")
|
||||
//err = errors.New("no valid search options specified")
|
||||
//return secretResults, err
|
||||
}
|
||||
} else {
|
||||
// Determine whether to query for a specific device or a category of devices
|
||||
@@ -77,9 +78,10 @@ func GetSecrets(s *Secret, adminRole bool) ([]Secret, error) {
|
||||
} else if s.DeviceCategory != "" {
|
||||
rows, err = db.Queryx("SELECT * FROM secrets WHERE DeviceCategory LIKE ? AND RoleId = ?", s.DeviceCategory, s.RoleId)
|
||||
} else {
|
||||
log.Printf("GetSecret no valid search options specified\n")
|
||||
err = errors.New("no valid search options specified")
|
||||
return secretResults, err
|
||||
rows, err = db.Queryx("SELECT * FROM secrets WHERE RoleId = ?", s.RoleId)
|
||||
//log.Printf("GetSecret no valid search options specified\n")
|
||||
//err = errors.New("no valid search options specified")
|
||||
//return secretResults, err
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user