mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-29 18:27:58 +08:00
[FIX] fix save in codecheck and event
This commit is contained in:
parent
039ce238cf
commit
2f877cac6a
@ -38,7 +38,7 @@ func (c *CodeCheckResultDaoImpl) AddModel(mo model.Interface) error {
|
||||
fmt.Errorf("codecheck result is exist")
|
||||
update(result, &oldResult)
|
||||
|
||||
if err := c.DB.Save(oldResult).Error; err != nil {
|
||||
if err := c.DB.Save(&oldResult).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@ -52,7 +52,7 @@ func (c *CodeCheckResultDaoImpl) UpdateModel(mo model.Interface) error {
|
||||
var oldResult model.CodeCheckResult
|
||||
if ok := c.DB.Where("service_id=?", result.ServiceID).Find(&oldResult).RecordNotFound(); !ok {
|
||||
update(result, &oldResult)
|
||||
if err := c.DB.Save(oldResult).Error; err != nil {
|
||||
if err := c.DB.Save(&oldResult).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ func (c *EventDaoImpl) UpdateModel(mo model.Interface) error {
|
||||
finalUpdateEvent(result, &oldResult)
|
||||
oldB, _ := json.Marshal(oldResult)
|
||||
logrus.Infof("update event to %s", string(oldB))
|
||||
if err := c.DB.Save(oldResult).Error; err != nil {
|
||||
if err := c.DB.Save(&oldResult).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user