Skip to content

Commit

Permalink
[HOTFIX]
Browse files Browse the repository at this point in the history
  • Loading branch information
karnelll authored Oct 31, 2024
1 parent e198360 commit 94501ec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fe/src/app/event-maps/[id]/components/BottomDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export default function BottomDrawer({
"/profile/profil4.svg",
]);

const apiUrl = process.env.NEXT_PUBLIC_API_BASE_URL; // 환경 변수로부터 API URL 가져오기

useEffect(() => {
// 프로필 이미지 랜덤 할당
const profiles = nonMembers.reduce(
Expand All @@ -63,9 +65,7 @@ export default function BottomDrawer({
// 전체 pings 데이터를 처음 로드할 때 가져옴
const fetchAllPings = async () => {
try {
const response = await fetch(
`http://110.165.17.236:8081/api/v1/nonmembers/pings?uuid=${id}`
);
const response = await fetch(`${apiUrl}/nonmembers/pings?uuid=${id}`);
if (response.ok) {
const data = await response.json();
setAllPings(data.pings || []);
Expand All @@ -76,7 +76,7 @@ export default function BottomDrawer({
}
};
fetchAllPings();
}, [id, setCustomMarkers]);
}, [apiUrl, id, setCustomMarkers]);

const handleLocationClick = () => {
if (navigator.geolocation) {
Expand All @@ -102,7 +102,7 @@ export default function BottomDrawer({
// 특정 nonMemberId에 대한 핑 요청
try {
const response = await fetch(
`${process.env.NEXT_PUBLIC_API_BASE_URL}/nonmembers/pings/${nonMemberId}`,
`${apiUrl}/nonmembers/pings/${nonMemberId}`,
{ method: "GET", headers: { "Content-Type": "application/json" } }
);

Expand Down

0 comments on commit 94501ec

Please sign in to comment.