Skip to content

Commit

Permalink
오류 수정
Browse files Browse the repository at this point in the history
 * 인식된 재료 없음 -> 경고창 표시
  • Loading branch information
rkdgusdnr99 committed May 29, 2024
1 parent 369baf7 commit 1bd10be
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions frontend/src/app/recommend/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,18 @@ export default function Recommend() {
}

const result = await response.text();
setIngredients(result.split(', '));
setFirstIngredients(result);
setMiddleIngredients(result);
console.log(result);
console.log(middleIngredients);
// 다음 단계로 이동
setStep((prevStep) => prevStep + 2);
if (result === "") {
window.alert("재료가 인식되지 않았습니다. 다시 시도해주세요.")
}
else {
setIngredients(result.split(', '));
setFirstIngredients(result);
setMiddleIngredients(result);
console.log(result);
console.log(middleIngredients);
// 다음 단계로 이동
setStep((prevStep) => prevStep + 2);
}
} catch (error) {
console.error('파일 업로드 에러:', error);
}
Expand Down

0 comments on commit 1bd10be

Please sign in to comment.