converted string param to struct

This commit is contained in:
Radu Ioan Fericean
2014-10-21 13:54:44 +03:00
parent 63117baf6d
commit 8df256fb8d

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"