mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-01-25 02:08:24 +00:00
fixed filter for carriers for an account
This commit is contained in:
@@ -12,10 +12,12 @@ class VoipCarrier extends Model {
|
||||
static _criteriaBuilder(obj, args) {
|
||||
let sql = '';
|
||||
if (obj.account_sid) {
|
||||
sql += ' AND vc.account_sid = ?';
|
||||
sql += ` AND (vc.account_sid = ? OR
|
||||
(vc.account_sid IS NULL AND vc.service_provider_sid IN
|
||||
(SELECT service_provider_sid FROM accounts WHERE account_sid = ?))
|
||||
)`;
|
||||
args.push(obj.account_sid);
|
||||
args.push(obj.account_sid);
|
||||
} else {
|
||||
sql += ' AND vc.account_sid IS NULL';
|
||||
}
|
||||
if (obj.service_provider_sid) {
|
||||
sql += ' AND vc.service_provider_sid = ?';
|
||||
|
||||
Reference in New Issue
Block a user