mirror of
https://github.com/portainer/portainer.git
synced 2025-08-09 15:55:23 +02:00
ssl dataservice fixed
This commit is contained in:
parent
5ce938123d
commit
cf5bec7f2d
2 changed files with 6 additions and 7 deletions
|
@ -18,14 +18,13 @@ func NewService(connection portainer.Connection) (*Service, error) {
|
||||||
|
|
||||||
// Settings retrieve the ssl settings object.
|
// Settings retrieve the ssl settings object.
|
||||||
func (service *Service) Settings() (*portainer.SSLSettings, error) {
|
func (service *Service) Settings() (*portainer.SSLSettings, error) {
|
||||||
var settings portainer.SSLSettings
|
var obj portainer.SSLSettings
|
||||||
db := service.connection.GetDB()
|
err := service.connection.GetByID(1, &obj)
|
||||||
tx := db.Take(&settings)
|
if err != nil {
|
||||||
if tx.Error != nil {
|
return nil, err
|
||||||
return nil, tx.Error
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return &settings, nil
|
return &obj, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateSettings persists a SSLSettings object.
|
// UpdateSettings persists a SSLSettings object.
|
||||||
|
|
|
@ -18,7 +18,7 @@ func NewService(connection portainer.Connection) (*Service, error) {
|
||||||
|
|
||||||
// User returns a user by ID
|
// User returns a user by ID
|
||||||
func (service *Service) User(ID portainer.UserID) (*portainer.User, error) {
|
func (service *Service) User(ID portainer.UserID) (*portainer.User, error) {
|
||||||
obj := portainer.User{}
|
var obj portainer.User
|
||||||
|
|
||||||
err := service.connection.GetByID(int(ID), &obj)
|
err := service.connection.GetByID(int(ID), &obj)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue