Fixed DispatcherHost related struct fields, added/fixed some tests and redesigned some functions in model_helpers.go

This commit is contained in:
nickolasdaniel
2021-07-14 13:51:56 +03:00
committed by Dan Christian Bogos
parent 2e3bc90c2a
commit 11d267b3d5
8 changed files with 168 additions and 90 deletions

View File

@@ -971,7 +971,10 @@ func (sqls *SQLStorage) GetTPDispatcherHosts(tpid, tenant, id string) ([]*utils.
if err := q.Find(&dpps).Error; err != nil {
return nil, err
}
arls := dpps.AsTPDispatcherHosts()
arls, err := dpps.AsTPDispatcherHosts()
if err != nil {
return nil, err
}
if len(arls) == 0 {
return arls, utils.ErrNotFound
}