Update tp resource to consider tenant

This commit is contained in:
TeoV
2019-01-09 03:27:45 -05:00
committed by Dan Christian Bogos
parent 2325f53550
commit b5708c18a5
12 changed files with 39 additions and 37 deletions

View File

@@ -1474,12 +1474,15 @@ func (self *SQLStorage) GetTPAliases(filter *utils.TPAliases) ([]*utils.TPAliase
}
}
func (self *SQLStorage) GetTPResources(tpid, id string) ([]*utils.TPResource, error) {
func (self *SQLStorage) GetTPResources(tpid, tenant, id string) ([]*utils.TPResource, error) {
var rls TpResources
q := self.db.Where("tpid = ?", tpid)
if len(id) != 0 {
q = q.Where("id = ?", id)
}
if len(tenant) != 0 {
q = q.Where("tenant = ?", tenant)
}
if err := q.Find(&rls).Error; err != nil {
return nil, err
}