mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-20 06:38:45 +05:00
Update tp resource to consider tenant
This commit is contained in:
committed by
Dan Christian Bogos
parent
2325f53550
commit
b5708c18a5
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user