mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-12 02:26:26 +05:00
converted string param to struct
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user