Fix/getvoicelanguage (#242)

* fix fetch eleven voice and language

* fix elevenlabs voice and language

* fix

* fix

* fix

* fix

* fix

* fix
This commit is contained in:
Hoan Luu Huu authored and GitHub committed 2023-10-20 08:41:26 +02:00
1 parent bf9ae3b5ce
commit a1c302f85c
2 files changed
+21 -8

No files matched your search

+3 -2
View File
@@ -23,9 +23,10 @@ class SpeechCredential extends Model {
static async getSpeechCredentialsByVendorAndLabel(service_provider_sid, account_sid, vendor, label) {
let sql;
if (account_sid) {
sql = 'SELECT * FROM speech_credentials WHERE account_sid = ? AND vendor = ? AND label = ?';
sql = `SELECT * FROM speech_credentials WHERE account_sid = ? AND vendor = ? ${label ? 'AND label = ?' : ''}`;
} else {
sql = 'SELECT * FROM speech_credentials WHERE service_provider_sid = ? AND vendor = ? AND label = ?';
sql = `SELECT * FROM speech_credentials WHERE service_provider_sid = ? AND vendor = ?
${label ? 'AND label = ?' : ''}`;
}
const [rows] = await promisePool.query(sql, [account_sid ? account_sid : service_provider_sid, vendor, label]);
return rows;