From 522c296286adff1b463feb269fed2f6bd5db19f8 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Tue, 18 Aug 2015 20:03:35 +0300 Subject: [PATCH] rem rating profile attribute check --- apier/v1/apier.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apier/v1/apier.go b/apier/v1/apier.go index 26397e691..f042b6c82 100644 --- a/apier/v1/apier.go +++ b/apier/v1/apier.go @@ -1160,6 +1160,15 @@ func (arrp *AttrRemoveRatingProfile) GetId() (result string) { } func (self *ApierV1) RemoveRatingProfile(attr AttrRemoveRatingProfile, reply *string) error { + if attr.Subject != "" && attr.Category == "" { + return fmt.Errorf("%s:%s", utils.ErrMandatoryIeMissing.Error(), "Category") + } + if attr.Category != "" && attr.Tennat == "" { + return fmt.Errorf("%s:%s", utils.ErrMandatoryIeMissing.Error(), "Tenant") + } + if attr.Tennat != "" && attr.Direction == "" { + return fmt.Errorf("%s:%s", utils.ErrMandatoryIeMissing.Error(), "Direction") + } err := self.RatingDb.RemoveRatingProfile(attr.GetId()) if err != nil { *reply = err.Error()