1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-09 15:55:23 +02:00

add sslsettings

This commit is contained in:
Matt Hook 2023-05-12 16:34:52 +12:00 committed by Prabhat Khera
parent 3396f1ca91
commit 357cb66fbf

View file

@ -29,12 +29,21 @@ func NewService(connection portainer.Connection) (*Service, error) {
// Settings retrieve the ssl settings object.
func (service *Service) Settings() (*portainer.SSLSettings, error) {
var settings portainer.SSLSettings
db := service.connection.GetDB()
tx := db.Take(&settings)
if tx.Error != nil {
return nil, tx.Error
}
return &settings, nil
}
// UpdateSettings persists a SSLSettings object.
func (service *Service) UpdateSettings(settings *portainer.SSLSettings) error {
// return service.connection.UpdateObject(BucketName, []byte(key), settings)
db := service.connection.GetDB()
tx := db.Model(&portainer.SSLSettings{}).Where(portainer.SSLSettings{}).FirstOrCreate(settings)
if tx.Error != nil {
return tx.Error
}
return nil
}