mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Fixed bug in utils/cgrevent.go
This commit is contained in:
committed by
Dan Christian Bogos
parent
ac3b788e69
commit
84d70f5a48
@@ -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
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user