fix: update custom stt/tss url

This commit is contained in:
Quan HL
2023-03-05 06:33:25 +07:00
parent 07421d830e
commit 4e59bcb9fa
2 changed files with 13 additions and 2 deletions

View File

@@ -86,6 +86,14 @@ SpeechCredential.fields = [
{
name: 'last_tested',
type: 'date'
},
{
name: 'custom_tts_url',
type: 'date'
},
{
name: 'custom_stt_url',
type: 'date'
}
];

View File

@@ -343,7 +343,8 @@ router.put('/:sid', async(req, res) => {
const sid = req.params.sid;
const logger = req.app.locals.logger;
try {
const {use_for_tts, use_for_stt, region, aws_region, stt_region, tts_region, riva_server_uri} = req.body;
const {use_for_tts, use_for_stt, region, aws_region, stt_region, tts_region,
riva_server_uri, custom_stt_url, custom_tts_url} = req.body;
if (typeof use_for_tts === 'undefined' && typeof use_for_stt === 'undefined') {
throw new DbErrorUnprocessableRequest('use_for_tts and use_for_stt are the only updateable fields');
}
@@ -379,7 +380,9 @@ router.put('/:sid', async(req, res) => {
custom_stt_endpoint,
stt_region,
tts_region,
riva_server_uri
riva_server_uri,
custom_stt_url,
custom_tts_url
};
logger.info({o, newCred}, 'updating speech credential with this new credential');
obj.credential = encryptCredential(newCred);