This commit is contained in:
DanB
2014-10-22 13:45:33 +02:00

View File

@@ -26,11 +26,15 @@ import (
"github.com/cgrates/cgrates/utils"
)
func (self *ApierV2) RemTP(tpid string, reply *string) error {
if len(tpid) == 0 {
type AttrRemTp struct {
TPid string
}
func (self *ApierV2) RemTP(attrs AttrRemTp, reply *string) error {
if len(attrs.TPid) == 0 {
return fmt.Errorf("%s:TPid", utils.ERR_MANDATORY_IE_MISSING)
}
if err := self.StorDb.RemTPData("", tpid); err != nil {
if err := self.StorDb.RemTPData("", attrs.TPid); err != nil {
return fmt.Errorf("%s:%s", utils.ERR_SERVER_ERROR, err.Error())
} else {
*reply = "OK"