Fixed bug in utils/cgrevent.go

This commit is contained in:
andronache
2021-04-13 15:37:05 +03:00
committed by Dan Christian Bogos
parent ac3b788e69
commit 84d70f5a48
2 changed files with 2 additions and 2 deletions

View File

@@ -97,7 +97,7 @@ func (ev *CGREvent) FieldAsDuration(fldName string) (d time.Duration, err error)
// OptAsDuration returns an option as Duration instance
func (ev *CGREvent) OptAsDuration(optName string) (d time.Duration, err error) {
iface, has := ev.Event[optName]
iface, has := ev.APIOpts[optName]
if !has {
err = ErrNotFound
return

View File

@@ -510,7 +510,7 @@ func TestCGREventOptAsDurationEmpty(t *testing.T) {
func TestCGREventOptAsDuration(t *testing.T) {
ev := &CGREvent{
Event: map[string]interface{}{
APIOpts: map[string]interface{}{
"testKey": 30,
},
}