Commit 6737253b authored by Yoann HOUPERT's avatar Yoann HOUPERT

manage indice data

parent adf5ed37
Pipeline #10775 passed with stage
in 36 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 (err) {
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