diff --git a/client/src/store/actions.ts b/client/src/store/actions.ts index e8efe071..353c6f85 100644 --- a/client/src/store/actions.ts +++ b/client/src/store/actions.ts @@ -644,10 +644,15 @@ export const sendQuestion = queryMentor(mentor, q.question, q.config) .then((r) => { const { data } = r; + const answer_media = [ + data.answer_media.web_media, + data.answer_media.mobile_media, + data.answer_media.vtt_media, + ]; const response: QuestionResponse = { answerId: data.answer_id, answerText: data.answer_text, - answerMedia: data.answer_media, + answerMedia: answer_media, answerClassifier: data.classifier, answerConfidence: data.confidence, answerIsOffTopic: data.confidence <= RESPONSE_CUTOFF, diff --git a/client/src/types.ts b/client/src/types.ts index 62d74c5b..db0100c3 100644 --- a/client/src/types.ts +++ b/client/src/types.ts @@ -76,11 +76,17 @@ export interface Media { url: string; } +interface AnswerMediaClassifier { + web_media: Media; + mobile_media: Media; + vtt_media: Media; +} + export interface QuestionApiData { query: string; answer_id: string; answer_text: string; - answer_media: Media[]; + answer_media: AnswerMediaClassifier; confidence: number; feedback_id: string; classifier: string;