Skip to content

Commit

Permalink
πŸ”§ WV-46 fix : μ—”λ“œν¬μΈνŠΈ μˆ˜μ •
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinviz committed Jan 16, 2025
1 parent 2d76428 commit ee80ad9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions api/game/apis.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export async function getMonthSchedules(params: string) {
try {
const res = await fetch(
`/game/monthschedule?yearMonth=${params}`
`/api/game/monthschedule?yearMonth=${params}`
);

if (!res.ok) {
Expand All @@ -19,7 +19,7 @@ export async function getMonthSchedules(params: string) {
export async function getAllSchedules(params: string) {
try {
const res = await fetch(
`/game/allgameschedule?yearMonth=${params}`
`/api/game/allgameschedule?yearMonth=${params}`
);

if (!res.ok) {
Expand All @@ -39,7 +39,7 @@ export const fetchBoxscore = async (gameDate?: number, gmkey?: string) => {
const queryparams =
gameDate && gmkey ? `?gameDate=${gameDate}&gmkey=${gmkey}` : "";

const URL = `/game/boxscore${queryparams}`;
const URL = `/api/game/boxscore${queryparams}`;

const response = await fetch(URL);

Expand Down
6 changes: 3 additions & 3 deletions api/player/apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CoachDetailResponse, CoachResponse, PitcherResponse } from "./types";

// player - μ½”μΉ˜ 리슀트
export const getCoachList = async (): Promise<CoachInfo[]> => {
const url = `/player/coachlist`;
const url = `/api/player/coachlist`;
const res = await fetch(url);

if (!res.ok) {
Expand All @@ -15,7 +15,7 @@ export const getCoachList = async (): Promise<CoachInfo[]> => {

// player - 투수 리슀트
export const getPitcherList = async (): Promise<PitcherInfo[]> => {
const url = `/player/pitcherlist`;
const url = `/api/player/pitcherlist`;
const res = await fetch(url, { method: "GET" });
if (!res.ok) {
throw new Error("Failed to fetch coach list");
Expand All @@ -30,7 +30,7 @@ export const getCoachDetail = async (
pcode: string
): Promise<CoachDetailResponse["data"]> => {
const queryparam = pcode ? `coachdetail?pcode=${pcode}` : "";
const url = ` /player/${queryparam}`;
const url = `/api/player/${queryparam}`;
const response = await fetch(url, { method: "GET" });

if (!response.ok) {
Expand Down
2 changes: 1 addition & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const nextConfig = {
return [
{
source: "/api/:path*", // λͺ¨λ“  /api/* μš”μ²­μ„ ν”„λ‘μ‹œ (ν˜„μž¬ API μ„œλ²„μ˜ λͺ¨λ“  μ—”λ“œν¬μΈνŠΈλŠ”λŠ” /api/*둜 μ‹œμž‘)
destination: `${process.env.NEXT_PUBLIC_API_KEY}/:path*`, // μ‹€μ œ API μ„œλ²„(λ°±μ—”λ“œ)둜 Request
destination: `${process.env.NEXT_PUBLIC_API_KEY}/api/:path*`, // μ‹€μ œ API μ„œλ²„(λ°±μ—”λ“œ)둜 Request
},
];
},
Expand Down

0 comments on commit ee80ad9

Please sign in to comment.