diff --git a/routes/infrastructure-component/ic_methods.go b/routes/infrastructure-component/ic_methods.go index d7b082d..7c9c307 100644 --- a/routes/infrastructure-component/ic_methods.go +++ b/routes/infrastructure-component/ic_methods.go @@ -52,6 +52,12 @@ func (s *InfrastructureComponent) update(updatedIC InfrastructureComponent) erro db := database.GetDB() err := db.Model(s).Updates(updatedIC).Error + if err != nil { + return err + } + + // extra update for bool ManagedExternally since it is ignored if false + err = db.Model(s).Updates(map[string]interface{}{"ManagedExternally": updatedIC.ManagedExternally}).Error return err } diff --git a/routes/scenario/scenario_methods.go b/routes/scenario/scenario_methods.go index 9f76bab..dbd6cb6 100644 --- a/routes/scenario/scenario_methods.go +++ b/routes/scenario/scenario_methods.go @@ -63,6 +63,12 @@ func (s *Scenario) update(updatedScenario Scenario) error { db := database.GetDB() err := db.Model(s).Update(updatedScenario).Error + if err != nil { + return err + } + + // extra update for bool IsLocked since it is ignored if false + err = db.Model(s).Updates(map[string]interface{}{"IsLocked": updatedScenario.IsLocked}).Error return err } diff --git a/routes/user/user_methods.go b/routes/user/user_methods.go index 885af6d..87981bc 100644 --- a/routes/user/user_methods.go +++ b/routes/user/user_methods.go @@ -124,8 +124,11 @@ func (u *User) update(updatedUser User) error { db := database.GetDB() err := db.Model(u).Update(updatedUser).Error + if err != nil { + return err + } - // extra update for bool active since it is ignored if false + // extra update for bool Active since it is ignored if false err = db.Model(u).Updates(map[string]interface{}{"Active": updatedUser.Active}).Error return err