mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(notify): update database when change subscriber's identification
This commit is contained in:
@@ -260,9 +260,21 @@ func (s *SSubscriber) PerformChange(ctx context.Context, userCred mcclient.Token
|
||||
log.Errorf("unable to set receivers %s", input.Receivers)
|
||||
}
|
||||
case api.SUBSCRIBER_TYPE_ROBOT:
|
||||
s.Identification = input.Robot
|
||||
_, err := db.Update(s, func() error {
|
||||
s.Identification = input.Robot
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "unable to update subscriber")
|
||||
}
|
||||
case api.SUBSCRIBER_TYPE_ROLE:
|
||||
s.Identification = input.Role
|
||||
_, err := db.Update(s, func() error {
|
||||
s.Identification = input.Role
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "unable to update subscriber")
|
||||
}
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user