Skip to content

Commit

Permalink
fix : 답변 채택 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
HA-SEUNG-JEONG committed May 3, 2024
1 parent 74aff32 commit 0bbe5db
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/ui/question/answer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ function AnswerModule({
}: AnswerDetailProps) {
const [isAdopted, setIsAdopted] = useState(false);
const handleAdoptAnswer = async () => {
await fetchAPI(`/api/answer/selection/${answerId}`, 'PATCH', {
selection: true,
});

setIsAdopted(true);
if (confirm('채택하시겠습니까?'))
if (confirm('채택하시겠습니까?')) {
await fetchAPI(`/api/answer/selection/${answerId}`, 'PATCH', {
selection: true,
});
setIsAdopted(true);
showSuccessToast('답변이 채택되었습니다.');
}
};

return (
Expand Down

0 comments on commit 0bbe5db

Please sign in to comment.