Skip to content

Commit 3921af6

Browse files
committed
refact: 불필요한 console.log 제거
1 parent 23c13f8 commit 3921af6

File tree

16 files changed

+179
-248
lines changed

16 files changed

+179
-248
lines changed

src/features/event/hooks/usePresignedUrlHook.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const getPresignedUrl = async (dto: PresignedUrlRequest) => {
99
const response = await axiosClient.get<ApiResponse<PresignedUrlResponse>>('/generate-presigned-url', {
1010
params: dto,
1111
});
12-
console.log('Presigned URL 응답:', response.data.result?.preSignedUrl);
1312

1413
return response.data.result?.preSignedUrl;
1514
} catch (error) {
@@ -21,14 +20,12 @@ const getPresignedUrl = async (dto: PresignedUrlRequest) => {
2120
export const putS3Image = async ({ url, file }: { url: string; file: File }) => {
2221
try {
2322
delete axiosClient.defaults.headers.common.Authorization;
24-
console.log('업로드할 URL:', url);
2523
await axios.put(url, file, {
2624
headers: {
2725
'Content-Type': 'image/webp',
2826
},
2927
});
30-
} catch (error) {
31-
console.error('S3 업로드 실패:', error);
28+
} catch {
3229
alert('이미지 업로드에 실패했습니다.');
3330
throw new Error('Failed to upload image');
3431
}
@@ -45,7 +42,6 @@ export const uploadFile = async (file: File) => {
4542
}
4643

4744
const url = presignedUrlResponse;
48-
console.log('Presigned URL:', url);
4945

5046
await putS3Image({ url, file: webFile });
5147

src/features/event/ui/DatePicker.tsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,13 @@ const EventDatePicker = ({
2727
isLabel = false,
2828
}: DatePickerProps) => {
2929
const [startDate, setStartDate] = useState<Date | null>(
30-
eventState?.startDate
31-
? new Date(eventState.startDate)
32-
: initialStartDate
33-
? new Date(initialStartDate)
34-
: new Date()
30+
eventState?.startDate ? new Date(eventState.startDate) : initialStartDate ? new Date(initialStartDate) : new Date()
3531
);
3632

3733
const [endDate, setEndDate] = useState<Date | null>(
38-
eventState?.endDate
39-
? new Date(eventState.endDate)
40-
: initialEndDate
41-
? new Date(initialEndDate)
42-
: new Date()
34+
eventState?.endDate ? new Date(eventState.endDate) : initialEndDate ? new Date(initialEndDate) : new Date()
4335
);
4436

45-
console.log('startDate', startDate);
46-
console.log('endDate', endDate);
47-
4837
const [startTime, setStartTime] = useState<string>(
4938
extractTimeFromDateString(eventState?.startDate || initialStartDate, '06:00')
5039
);
@@ -86,7 +75,6 @@ const EventDatePicker = ({
8675
}
8776
}, [eventState?.startDate, eventState?.endDate, initialStartDate, initialEndDate]);
8877

89-
9078
const generateTimeOptions = () => {
9179
const options = [];
9280
for (let i = 0; i < 24; i++) {

src/features/event/ui/ShareEventModal.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ const ShareEventModal = ({
6666
const handleKakaoShare = async () => {
6767
try {
6868
await shareToKakao(title, description, eventImageUrl, eventUrl);
69-
} catch (error) {
70-
console.error('카카오 공유 실패:', error);
69+
} catch {
7170
alert('카카오 공유하기에 실패했습니다.');
7271
}
7372
};
@@ -89,8 +88,7 @@ const ShareEventModal = ({
8988
navigator.clipboard
9089
.writeText(eventUrl)
9190
.then(() => alert('링크가 복사되었습니다!'))
92-
.catch(err => {
93-
console.error('복사 실패:', err);
91+
.catch(() => {
9492
alert('링크 복사에 실패했습니다.');
9593
});
9694
} else {

src/features/event/ui/TimePicker.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,8 @@ const parseUtcToKst = (utcString: string): Date => {
1616
const TimePicker = ({ value, onChange }: TimePickerProps) => {
1717
const initialKstDate = value ? parseUtcToKst(value) : new Date();
1818
const [selectedDate, setSelectedDate] = useState<Date | null>(initialKstDate);
19-
const [selectedHour, setSelectedHour] = useState<string>(
20-
initialKstDate.getHours().toString().padStart(2, '0')
21-
);
22-
const [selectedMinute, setSelectedMinute] = useState<string>(
23-
initialKstDate.getMinutes().toString().padStart(2, '0')
24-
);
19+
const [selectedHour, setSelectedHour] = useState<string>(initialKstDate.getHours().toString().padStart(2, '0'));
20+
const [selectedMinute, setSelectedMinute] = useState<string>(initialKstDate.getMinutes().toString().padStart(2, '0'));
2521

2622
useEffect(() => {
2723
if (value) {
@@ -47,7 +43,6 @@ const TimePicker = ({ value, onChange }: TimePickerProps) => {
4743
const localString = `${year}-${month}-${day}T${hour}:${minute}:00`;
4844

4945
onChange(localString);
50-
console.log(localString);
5146
}
5247
}, [selectedDate, selectedHour, selectedMinute]);
5348

src/features/ticket/hooks/useTicketOptionForm.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ export const useTicketOptionForm = () => {
139139
const handleSave = () => {
140140
let isValid = true;
141141

142-
console.log('Clicked!');
143-
144142
if (state.question.title.trim() === '') {
145143
dispatch({
146144
type: 'SET_WARNING',

src/features/ticket/hooks/useTicketOptionHook.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ export const useTicketOptions = (ticketId: number) => {
3838
export const useCreateTicketOptionAnswers = () => {
3939
return useMutation<ApiResponse<null>, Error, TicketOptionAnswerRequest>({
4040
mutationFn: createTicketOptionAnswers,
41-
onSuccess: () => {
42-
console.log('티켓 옵션 응답 전송 성공');
43-
},
4441
onError: () => {
4542
alert('티켓 옵션 응답 전송 중 오류가 발생했습니다.');
4643
},
@@ -177,10 +174,6 @@ export const useAttachTicketOptionMutation = () => {
177174
onSuccess: (_data, variables) => {
178175
// 티켓별 옵션 목록 쿼리 리패칭
179176
queryClient.invalidateQueries({ queryKey: ['attachedTicketOptions', variables.ticketId] });
180-
console.log('티켓 옵션이 성공적으로 부착되었습니다.');
181-
},
182-
onError: () => {
183-
console.log('티켓 옵션 부착에 실패했습니다. 다시 시도해주세요.');
184177
},
185178
});
186179
};
@@ -194,10 +187,6 @@ export const useDetachTicketOptionMutation = () => {
194187
onSuccess: (_data, variables) => {
195188
// 티켓별 옵션 목록 쿼리 리패칭
196189
queryClient.invalidateQueries({ queryKey: ['attachedTicketOptions', variables.ticketId] });
197-
console.log('티켓에 부착된 티켓 옵션이 성공적으로 부착 취소되었습니다.');
198-
},
199-
onError: () => {
200-
console.log('티켓에 부착된 티켓 옵션 부착 취소에 실패했습니다. 다시 시도해주세요.');
201190
},
202191
});
203192
};

src/pages/dashboard/ui/EventDetailPage.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ const EventDetailPage = () => {
2222
const [referenceLinks, setReferenceLinks] = useState<Link[]>([]);
2323

2424
const queryClient = useQueryClient();
25-
25+
2626
useEffect(() => {
27-
console.log(data?.result.bannerImageUrl)
2827
if (data?.result) {
2928
setHostChannelId(data.result.hostChannelId || 0);
3029
setBannerImageUrl(prev => prev || data.result.bannerImageUrl || '');
@@ -73,7 +72,7 @@ const EventDetailPage = () => {
7372
<div className="flex flex-col gap-5 mt-8 px-7">
7473
<h1 className="text-center text-xl font-bold mb-5">이벤트 상세 정보</h1>
7574
<FileUpload value={bannerImageUrl} onChange={setBannerImageUrl} useDefaultImage={false} />
76-
<TextEditor value={description} onChange={setDescription}/>
75+
<TextEditor value={description} onChange={setDescription} />
7776
<LinkInput value={referenceLinks} onChange={setReferenceLinks} />
7877
</div>
7978
<div className="w-full p-7">

src/pages/dashboard/ui/EventInfoPage.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ const EventInfoPage = () => {
6666
queryClient.invalidateQueries({ queryKey: ['eventDetail', data.result.id] });
6767
navigate(`/dashboard/${data?.result.id}`);
6868
},
69-
onError: error => {
70-
console.error('Error details:', error);
69+
onError: () => {
7170
alert('저장에 실패했습니다.');
7271
},
7372
});
@@ -93,7 +92,7 @@ const EventInfoPage = () => {
9392

9493
return (
9594
// <DashboardLayout centerContent={title}>
96-
<DashboardLayout centerContent={"DASHBOARD"}>
95+
<DashboardLayout centerContent={'DASHBOARD'}>
9796
<div className="flex flex-col gap-5 mt-8 px-7">
9897
<h1 className="text-center text-xl font-bold mb-5">이벤트 기본 정보</h1>
9998
<DefaultTextField

src/pages/event/ui/host/HostSelectionPage.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ const HostSelectionPage = ({ onNext, currentStep, onValidationChange }: HostSele
3939
}
4040
},
4141
onError: error => {
42-
console.error('호스트 삭제 실패:', error);
4342
alert(`${error.message}`);
4443
},
4544
});
@@ -61,7 +60,7 @@ const HostSelectionPage = ({ onNext, currentStep, onValidationChange }: HostSele
6160
<button className="flex justify-center items-center w-12 h-12 md:w-14 md:h-14 bg-gray2 rounded-full">
6261
<IconButton
6362
iconPath={<img src={AddButton} alt="추가 버튼" className="w-6 h-6 md:w-7 md:h-7" />}
64-
onClick={() => { }}
63+
onClick={() => {}}
6564
/>
6665
</button>
6766
<span className="font-bold text-base md:text-xl ml-4">채널 새로 만들기</span>

src/pages/join/AuthCallback.tsx

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,35 @@
1-
import { useNavigate, useSearchParams } from "react-router-dom";
2-
import useAuthStore from "../../app/provider/authStore";
3-
import { useEffect } from "react";
4-
import { useUserInfo } from "../../features/join/hooks/useUserHook";
1+
import { useNavigate, useSearchParams } from 'react-router-dom';
2+
import useAuthStore from '../../app/provider/authStore';
3+
import { useEffect } from 'react';
4+
import { useUserInfo } from '../../features/join/hooks/useUserHook';
55

66
const AuthCallback = () => {
7-
const navigate = useNavigate();
8-
const [searchParams] = useSearchParams();
9-
const status = searchParams.get('status'); // 'new' or 'existing'
10-
const { login, setName, closeModal } = useAuthStore();
11-
const { data } = useUserInfo();
7+
const navigate = useNavigate();
8+
const [searchParams] = useSearchParams();
9+
const status = searchParams.get('status'); // 'new' or 'existing'
10+
const { login, setName, closeModal } = useAuthStore();
11+
const { data } = useUserInfo();
1212

13-
useEffect(() => {
14-
const handleAuth = async () => {
15-
if (!data) return;
16-
try {
17-
closeModal();
18-
if (status === 'new') {
19-
navigate('/join/agreement');
20-
} else {
21-
login();
22-
setName(data?.name || "사용자");
23-
navigate('/');
24-
}
25-
} catch (error) {
26-
console.error('인증 처리 실패', error);
27-
navigate('/');
28-
}
29-
};
30-
handleAuth();
31-
}, [data, navigate, login, status, setName, closeModal]);
13+
useEffect(() => {
14+
const handleAuth = async () => {
15+
if (!data) return;
16+
try {
17+
closeModal();
18+
if (status === 'new') {
19+
navigate('/join/agreement');
20+
} else {
21+
login();
22+
setName(data?.name || '사용자');
23+
navigate('/');
24+
}
25+
} catch {
26+
navigate('/');
27+
}
28+
};
29+
handleAuth();
30+
}, [data, navigate, login, status, setName, closeModal]);
3231

33-
return <div className="text-center mt-32 text-lg font-bold">로그인 중입니다...</div>;
32+
return <div className="text-center mt-32 text-lg font-bold">로그인 중입니다...</div>;
3433
};
3534

3635
export default AuthCallback;
37-
38-

0 commit comments

Comments
 (0)