Commit 5c5b5b8f authored by Yoann HOUPERT's avatar Yoann HOUPERT

manage indice data

parent adf5ed37
Pipeline #10773 failed with stage
in 45 seconds
......@@ -57,11 +57,23 @@ const routesFactory = config => {
return res.status(interalServerCode).json({module: 'Offline transcription', error: 'Error during audio transcription'});
}
const transcription = JSON.parse(json.transcript).transcript;
const jsonResponse = {
status: 0,
hypotheses: JSON.parse(transcription),
id: uuidv1()
};
let jsonResponse = {};
//Depend on the offline server
try{
jsonResponse = {
status: 0,
hypotheses: JSON.parse(transcription),
id: uuidv1()
}
}catch(error){
jsonResponse = {
status: 0,
hypotheses: [{
utterance: transcription
}],
id: uuidv1()
}
}
return res.status(200).json({message: 'Transcript done', transcript: jsonResponse});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment