From 1943e3c6a7d486947e507d26d036a1774f616b19 Mon Sep 17 00:00:00 2001 From: Quan HL Date: Sat, 14 Oct 2023 12:37:22 +0700 Subject: [PATCH] fix --- lib/routes/api/speech-credentials.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/routes/api/speech-credentials.js b/lib/routes/api/speech-credentials.js index fea04104..1fc1b998 100644 --- a/lib/routes/api/speech-credentials.js +++ b/lib/routes/api/speech-credentials.js @@ -811,8 +811,13 @@ const getTtsVoices = async(vendor, label, service_provider_sid, account_sid) => return resp ? resp.voices.map((v) => { return { value: v.voice_id, - name: `${v.name}${v.category !== 'premade' ? ` (${v.category})` : ''} - ${v.labels.accent}, -${v.labels.description}, ${v.labels.age}, ${v.labels.gender}, ${v.labels['use case']}` + name: `${v.name}${v.category !== 'premade' ? ` (${v.category})` : ''} - +${v.labels.accent ? ` ${v.labels.accent},` : ''} +${v.labels.description ? ` ${v.labels.description},` : ''} +${v.labels.age ? ` ${v.labels.age},` : ''} +${v.labels.gender ? ` ${v.labels.gender},` : ''} +${v.labels['use case'] ? ` ${v.labels['use case']},` : ''} +` }; }).sort((a, b) => a.name.localeCompare(b.name)) : []; }