diff --git a/frontend/src/components/InterviewForm/useInterviewForm.tsx b/frontend/src/components/InterviewForm/useInterviewForm.tsx index e5bdee5..300e57c 100644 --- a/frontend/src/components/InterviewForm/useInterviewForm.tsx +++ b/frontend/src/components/InterviewForm/useInterviewForm.tsx @@ -65,8 +65,16 @@ export const useInterviewForm = (interviewId: number) => { } const requestAiFeedback = async ({answer, question} : {answer: string, question: string}) => { - return await answerFeedbackMutation.mutateAsync({ - answer, question + return await answerFeedbackMutation.mutateAsync({ + answer, + question, + tailQuestions: [ + interview.question === question ? "" : interview.question, + ...interviewForm.chatList + .filter(chat => chat.type === "TailQuestion") + .map(chat => chat.content) + .filter((_, index, arr) => arr.length - 1 !== index)] + .filter(str => str.length !== 0) }) } @@ -134,9 +142,9 @@ export const useInterviewForm = (interviewId: number) => { appendChat({type: 'Answer', content: interviewForm.answer}); const {tailQuestion, feedback, score} = await requestAiFeedback({ - answer: interviewForm.answer, - question: interviewForm.currentTailQuestion - }); + answer: interviewForm.answer, + question: interviewForm.currentTailQuestion + }); appendChat({type: 'TailQuestion', content: tailQuestion}); registerTailQuestion(tailQuestion); diff --git a/frontend/src/types/interview.ts b/frontend/src/types/interview.ts index c57b8ea..c0a0cac 100644 --- a/frontend/src/types/interview.ts +++ b/frontend/src/types/interview.ts @@ -164,6 +164,7 @@ export interface TailQuestionDetail { export interface FeedbackRequest{ question: string; answer: string; + tailQuestions: string[]; } export interface FeedbackResponse {