diff --git a/lib/models/client.js b/lib/models/client.js index a90a473c..7a78cae8 100644 --- a/lib/models/client.js +++ b/lib/models/client.js @@ -15,7 +15,7 @@ class Client extends Model { static async retrieveAllByServiceProviderSid(service_provider_sid) { const sql = `SELECT c.client_sid, c.account_sid, c.is_active, c.username, c.password FROM ${this.table} AS c LEFT JOIN accounts AS acc ON c.account_sid = acc.account_sid - LEFT JOIN service_providers AS sp ON sp.service_provider_sid = accs.service_provider_sid + LEFT JOIN service_providers AS sp ON sp.service_provider_sid = acc.service_provider_sid WHERE sp.service_provider_sid = ?`; const [rows] = await promisePool.query(sql, service_provider_sid); return rows;