Skip to content

Commit

Permalink
refactor: api요청 코드 api모듈 사용
Browse files Browse the repository at this point in the history
  • Loading branch information
dmdmdkdkr committed Nov 28, 2023
1 parent 727fdd7 commit 3c26b7f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions frontend/src/apis/competitionList/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import api from '@/utils/api';

import { Competition } from './types';

const apiUrl = import.meta.env.VITE_API_URL;

export const fetchCompetitionList = async (): Promise<Competition[]> => {
try {
const response = await api.get<Competition[]>(`${apiUrl}competitions`);
const response = await api.get('/competitions');
return response.data;
} catch (error) {
console.error('Error fetching competitions:', (error as Error).message);
Expand Down

0 comments on commit 3c26b7f

Please sign in to comment.