Skip to content

Commit

Permalink
Merge pull request #14 from team-GDGline/feat/something
Browse files Browse the repository at this point in the history
feat: AI 서버 배포 완료 후 연결
  • Loading branch information
Catleap02 authored Nov 15, 2024
2 parents 8c10058 + 1c70af2 commit e43177e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/Camera/CameraPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ const CameraPage: React.FC = () => {
setLoading(true); // 로딩 상태 활성화
try {
// 1단계: AI API로 이미지 전송
const aiResponse = await axios.post("/ai/analyze", {
const aiResponse = await axios.post("34.64.216.227:8080", {
image: capturedImage,
});
const fishData = aiResponse.data.fishInfo;
const detections = aiResponse.data;

if (!fishData || fishData.length === 0) {
if (!detections || detections.length === 0) {
setLoading(false);
navigate("/notfound");
return;
Expand All @@ -137,7 +137,7 @@ const CameraPage: React.FC = () => {
// 2단계: 물고기 데이터 백엔드로 전송
const backendResponse = await axios.post(
"/api/v1/pokedex/update",
{ caughtPokemons: fishData },
{ caughtPokemons: detections },
{
headers: {
Authorization: `Bearer ${accessToken}`, // 인증 토큰
Expand Down

0 comments on commit e43177e

Please sign in to comment.