Skip to content

Commit 5f66ab3

Browse files
committed
chore: rm const BASE_URL
1 parent a1ba7fd commit 5f66ab3

10 files changed

Lines changed: 18 additions & 37 deletions

File tree

src/components/login/Login.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import {useNavigate} from "react-router-dom";
66

77
import './login.css';
88

9-
const BASE_URL = process.env.REACT_APP_BASE_URL;
10-
119
const Login = ({ user, setUser }) => {
1210
const navigate = useNavigate();
1311

@@ -40,7 +38,7 @@ const Login = ({ user, setUser }) => {
4038
const refreshToken = Cookies.get("refreshToken") || null;
4139

4240
const { data: backendData } = await axios.post(
43-
`${BASE_URL}/api/login/auth/oauth`,
41+
`https://localhost:8080/api/login/auth/oauth`,
4442
{
4543
accessToken: tokenResponse.access_token,
4644
refreshToken: refreshToken,
@@ -81,7 +79,7 @@ const Login = ({ user, setUser }) => {
8179

8280
const logout = async () => {
8381
try {
84-
await axios.post(`${BASE_URL}/api/login/auth/logout`,
82+
await axios.post(`https://www.ajouchong.com/api/login/auth/logout`,
8583
{},
8684
{ withCredentials: true }
8785
);

src/context/AuthContext.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { createContext, useContext, useState, useEffect, useCallback } from "react";
22

33
const AuthContext = createContext();
4-
const BASE_URL = process.env.REACT_APP_BASE_URL;
54

65
export const AuthProvider = ({ children }) => {
76
const [auth, setAuth] = useState(() => {
@@ -21,7 +20,7 @@ export const AuthProvider = ({ children }) => {
2120

2221
const fetchUser = useCallback(async (token) => {
2322
try {
24-
const response = await fetch(`${BASE_URL}/api/login/auth/info`, {
23+
const response = await fetch(`https://www.ajouchong.com/api/login/auth/info`, {
2524
method: "GET",
2625
headers: {
2726
Authorization: `Bearer ${token}`,

src/pages/agora/Agora.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import axios from "axios";
44

55
import './Agora.css';
66

7-
const BASE_URL = process.env.REACT_APP_BASE_URL;
8-
97
const AgoraPage = () => {
108
const [posts, setPosts] = useState([]);
119
const [loading, setLoading] = useState(false);
@@ -23,7 +21,7 @@ const AgoraPage = () => {
2321
const fetchPosts = async () => {
2422
setLoading(true);
2523
try {
26-
const response = await axios.get(`${BASE_URL}/api/agora`, {
24+
const response = await axios.get(`https://www.ajouchong.com/api/agora`, {
2725
withCredentials: true,
2826
});
2927

@@ -51,7 +49,7 @@ const AgoraPage = () => {
5149
if (!window.confirm("정말로 게시글을 삭제하시겠습니까?")) return;
5250

5351
try {
54-
const response = await axios.delete(`${BASE_URL}/api/admin/agora/${postId}`, {
52+
const response = await axios.delete(`https://www.ajouchong.com/api/admin/agora/${postId}`, {
5553
withCredentials: true,
5654
});
5755

src/pages/agora/AgoraDetail.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import axios from "axios";
44

55
import './AgoraDetail.css';
66

7-
const BASE_URL = process.env.REACT_APP_BASE_URL;
8-
97
const AgoraDetail = () => {
108
const { id } = useParams();
119
const navigate = useNavigate();
@@ -20,7 +18,7 @@ const AgoraDetail = () => {
2018
const fetchPost = useCallback(async () => {
2119
setLoading(true);
2220
try {
23-
const response = await axios.get(`${BASE_URL}/api/agora/${id}`, {
21+
const response = await axios.get(`https://www.ajouchong.com/api/agora/${id}`, {
2422
withCredentials: true,
2523
});
2624

@@ -50,7 +48,7 @@ const AgoraDetail = () => {
5048
setApproving(true);
5149
try {
5250
const response = await axios.put(
53-
`${BASE_URL}/api/admin/agora/${id}/approve`,
51+
`https://www.ajouchong.com/api/admin/agora/${id}/approve`,
5452
{},
5553
{ withCredentials: true }
5654
);

src/pages/member/member.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { useEffect, useState } from "react";
22
import axios from "axios";
33
import "./member.css";
44

5-
const BASE_URL = process.env.REACT_APP_BASE_URL;
6-
75
const Member = () => {
86
const [members, setMembers] = useState([]);
97
const [selectedMembers, setSelectedMembers] = useState([]);
@@ -16,7 +14,7 @@ const Member = () => {
1614
useEffect(() => {
1715
const fetchMembers = async () => {
1816
try {
19-
const response = await axios.get(`${BASE_URL}/api/admin/members`, {
17+
const response = await axios.get(`https://www.ajouchong.com/api/admin/members`, {
2018
withCredentials: true
2119
});
2220

@@ -63,7 +61,7 @@ const Member = () => {
6361
try {
6462
await Promise.all(
6563
selectedMembers.map(async (id) => {
66-
await axios.delete(`${BASE_URL}/api/admin/members/${id}`, {
64+
await axios.delete(`https://www.ajouchong.com/api/admin/members/${id}`, {
6765
withCredentials: true,
6866
});
6967
})
@@ -90,7 +88,7 @@ const Member = () => {
9088
if (!selectedMember) return;
9189

9290
try {
93-
const response = await axios.put(`${BASE_URL}/api/admin/members/${selectedMember.id}`,
91+
const response = await axios.put(`https://www.ajouchong.com/api/admin/members/${selectedMember.id}`,
9492
{ role: newRole },
9593
{ withCredentials: true }
9694
);

src/pages/notice/Notice.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import axios from 'axios';
44

55
import './notice.css';
66

7-
const BASE_URL = process.env.REACT_APP_BASE_URL;
8-
97
const Notice = () => {
108
const [posts, setPosts] = useState([]);
119
const [loading, setLoading] = useState(false);
@@ -23,7 +21,7 @@ const Notice = () => {
2321
const fetchPosts = async () => {
2422
setLoading(true);
2523
try {
26-
const response = await axios.get(`${BASE_URL}/api/notice`, {
24+
const response = await axios.get(`https://www.ajouchong.com/api/notice`, {
2725
headers: { 'Content-Type': 'application/json' },
2826
withCredentials: true,
2927
});
@@ -53,7 +51,7 @@ const Notice = () => {
5351

5452
setLoading(true);
5553
try {
56-
const response = await axios.delete(`${BASE_URL}/api/admin/notice/${id}`, {
54+
const response = await axios.delete(`https://www.ajouchong.com/api/admin/notice/${id}`, {
5755
withCredentials: true,
5856
});
5957

src/pages/notice/NoticeWrite.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { useNavigate } from 'react-router-dom';
33
import axios from 'axios';
44
import './noticeWrite.css';
55

6-
const BASE_URL = process.env.REACT_APP_BASE_URL;
7-
86
const NoticeWrite = () => {
97
const [title, setTitle] = useState('');
108
const [content, setContent] = useState('');
@@ -36,7 +34,7 @@ const NoticeWrite = () => {
3634
setLoading(true);
3735

3836
try {
39-
const response = await axios.post(`${BASE_URL}/api/admin/notice`, formData, {
37+
const response = await axios.post(`https://www.ajouchong.com/api/admin/notice`, formData, {
4038
headers: {
4139
'Content-Type': 'multipart/form-data',
4240
},

src/pages/partnership/Parnership.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import axios from "axios";
44

55
import './Partnership.css';
66

7-
const BASE_URL = process.env.REACT_APP_BASE_URL;
8-
97
const Partnership = () => {
108
const [posts, setPosts] = useState([]);
119
const [loading, setLoading] = useState(false);
@@ -23,7 +21,7 @@ const Partnership = () => {
2321
const fetchPosts = async () => {
2422
setLoading(true);
2523
try {
26-
const response = await axios.get(`${BASE_URL}/api/partnership`, {
24+
const response = await axios.get(`https://www.ajouchong.com/api/partnership`, {
2725
withCredentials: true,
2826
});
2927

@@ -53,7 +51,7 @@ const Partnership = () => {
5351

5452
setLoading(true);
5553
try {
56-
const response = await axios.delete(`${BASE_URL}/api/admin/partnership/${id}`, {
54+
const response = await axios.delete(`https://www.ajouchong.com/api/admin/partnership/${id}`, {
5755
withCredentials: true,
5856
});
5957

src/pages/partnership/PartnershipWrite.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import axios from "axios";
44

55
import "./PartnershipWrite.css";
66

7-
const BASE_URL = process.env.REACT_APP_BASE_URL;
8-
97
const PartnershipWrite = () => {
108
const [title, setTitle] = useState('');
119
const [content, setContent] = useState('');
@@ -37,7 +35,7 @@ const PartnershipWrite = () => {
3735
setLoading(true);
3836

3937
try {
40-
const response = await axios.post(`${BASE_URL}/api/admin/partnership`, formData, {
38+
const response = await axios.post(`https://www.ajouchong.com/api/admin/partnership`, formData, {
4139
headers: {
4240
'Content-Type': 'multipart/form-data',
4341
},

src/pages/qna/QnA.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { useNavigate } from "react-router-dom";
33
import axios from "axios";
44
import "./QnA.css";
55

6-
const BASE_URL = process.env.REACT_APP_BASE_URL;
7-
86
const QnA = () => {
97
const [posts, setPosts] = useState([]);
108
const [loading, setLoading] = useState(false);
@@ -22,7 +20,7 @@ const QnA = () => {
2220
const fetchPosts = async () => {
2321
setLoading(true);
2422
try {
25-
const response = await axios.get(`${BASE_URL}/api/qna`, {
23+
const response = await axios.get(`https://www.ajouchong.com/api/qna`, {
2624
headers: { 'Content-Type': 'application/json' },
2725
withCredentials: true,
2826
});
@@ -59,7 +57,7 @@ const QnA = () => {
5957
if (!window.confirm("정말로 게시글을 삭제하시겠습니까?")) return;
6058

6159
try {
62-
const response = await axios.delete(`${BASE_URL}/api/admin/qna/${postId}`, {
60+
const response = await axios.delete(`https://www.ajouchong.com/api/admin/qna/${postId}`, {
6361
withCredentials: true,
6462
});
6563

0 commit comments

Comments
 (0)