mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
guard on remove rating profile api
This commit is contained in:
@@ -1169,7 +1169,13 @@ func (self *ApierV1) RemoveRatingProfile(attr AttrRemoveRatingProfile, reply *st
|
||||
if attr.Tennat != "" && attr.Direction == "" {
|
||||
return fmt.Errorf("%s:%s", utils.ErrMandatoryIeMissing.Error(), "Direction")
|
||||
}
|
||||
err := self.RatingDb.RemoveRatingProfile(attr.GetId())
|
||||
_, err := engine.Guardian.Guard(func() (interface{}, error) {
|
||||
err := self.RatingDb.RemoveRatingProfile(attr.GetId())
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return 0, nil
|
||||
}, "RemoveRatingProfile")
|
||||
if err != nil {
|
||||
*reply = err.Error()
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user