Skip to content

Commit

Permalink
refactor: conflict error solve
Browse files Browse the repository at this point in the history
  • Loading branch information
swgvenghy committed Nov 5, 2024
1 parent e77b6e1 commit bc2ae38
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/hooks/use-preset-button.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,29 @@ const usePresetButton = () => {
}
};

const handleDetailTypeButtonClick = async (detailTypeName: string) => {
try {
addMessage({ content: detailTypeName, role: 'user' });
addMessage({ content: 'loading', role: 'system' });
setLoading(true);

const response = await fetchResponse(`${detailTypeName}에 대해 설명해줘 단 아래의 출력 형식을 반드시 따라줘
**[전형제목]**
**[전형방법]**
**[지원자격]**
**[제출서류]**
아래 버튼을 눌러 더 자세한 정보를 확인하거나 직접 질문해보세요!`);
updateStateWithResponse(response);
} catch (error) {
setLoading(false);
updateLastMessage('답변 생성에 실패했습니다. 새로고침해주세요');
}
};

return {
handleReferenceButtonClick,
handleButtonClick,
handleDetailTypeButtonClick,
};
};

Expand Down

0 comments on commit bc2ae38

Please sign in to comment.