Skip to content

Commit

Permalink
Merge pull request #98 from KT-vicddory/week6
Browse files Browse the repository at this point in the history
Week6
  • Loading branch information
SNXWXH authored Aug 1, 2024
2 parents c9ecec5 + 3aa2c93 commit ca80e09
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
3 changes: 0 additions & 3 deletions src/app/(main)/ranking/ai/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Graph from '@/components/ranking/Graph';
import MatchTeam from '@/components/ranking/MatchTeam';
// import dateFormat from '@/utils/dateFormat';
import winlossData from '#/data/winlossdata.json';
import july_schedule from '#/data/july_schedule.json';
import Image from 'next/image';
Expand Down Expand Up @@ -41,7 +40,6 @@ export default async function RankingAi() {
if (dayOfWeek !== 1) {
const pitcherRes: Response = await fetch(
`${process.env.BASE_URL}/api/startingPitcher?day_num=${day_num}`,
{ cache: 'no-store' },
);
const pitcherData: TPitcherData = await pitcherRes.json();

Expand Down Expand Up @@ -75,7 +73,6 @@ export default async function RankingAi() {
// 승리 예측 API
const gamePredict: Response = await fetch(
`${process.env.BASE_URL}/api/predict?opponentTeam=${team[1]}&pastWinRate=${total}&recentWinRate=${last}&stadiumInformatio=${stadiums}&startingPitcherInformation=${pitcher[1]}&weather=`,
{ cache: 'no-store' },
);
const gamePredictData: TGamePredictData = await gamePredict.json();
winPercent = parseInt(gamePredictData.toString().replace('%', ''));
Expand Down
7 changes: 3 additions & 4 deletions src/app/api/predict/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ export async function GET(req: NextRequest) {
weather: '',
},
}),
cache: 'no-store',
});

const data = await response.json();
return NextResponse.json(data.predictWinRate, {
headers: {
'Cache-Control': 'no-store',
},
// headers: {
// 'Cache-Control': 'no-store',
// },
});
} catch (error) {
throw new Error('Server-Failed to fetch predict Data');
Expand Down
7 changes: 3 additions & 4 deletions src/app/api/startingPitcher/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ export async function GET(req: NextRequest) {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ day_num }),
cache: 'no-store',
});

const data = await response.json();
return NextResponse.json(data, {
headers: {
'Cache-Control': 'no-store',
},
// headers: {
// 'Cache-Control': 'no-store',
// },
});
} catch (error) {
throw new Error('Server-Failed to fetch starting Data');
Expand Down

0 comments on commit ca80e09

Please sign in to comment.