Skip to content

Commit

Permalink
[Release] 🍎 0.6.2 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Min-swo committed Dec 30, 2024
1 parent f7197cc commit 35f8663
Show file tree
Hide file tree
Showing 24 changed files with 33 additions and 77 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "schedule-hanaro-front",
"private": true,
"version": "0.6.1",
"version": "0.6.2",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
1 change: 0 additions & 1 deletion src/api/admin/inquiry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const getInquiryList = async ({
category,
search_content,
}: InquirySearchConditions) => {
console.log(category);
return (await apiCall.get(
BASE_URL +
`?page=${page}&size=10${status ? `&status=` + InquiryStatusDetails[status] : ''}${category !== '전체' && category ? `&category=` + CategoryDetails[category] : ''}${search_content ? `&search_content=` + search_content : ''}`
Expand Down
5 changes: 0 additions & 5 deletions src/api/admin/visit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ export const getVisitDetail = async (visitId: number) => {
export const updateVisitStatus = async (visitId: number) => {
try {
const fullUrl = `${BASE_URL}/${visitId}/status`;
console.log('전체 URL:', fullUrl);

const response = await apiCall.patch(fullUrl);
console.log('μƒνƒœ μ—…λ°μ΄νŠΈ 응닡:', response);
return response as AdminVisitStatusUpdateResponse;
} catch (error) {
// AxiosError νƒ€μž…μœΌλ‘œ μΊμŠ€νŒ…
Expand Down Expand Up @@ -50,19 +48,16 @@ export const updateVisitStatus = async (visitId: number) => {
// ν˜„μž¬ 진행쀑인 상담 쑰회
export const getVisitStatus = async (sectionId: number) => {
try {
console.log('API 호좜 μ‹œμž‘:', `${BASE_URL}/sections/${sectionId}/current`);
const response = await apiCall.get(
`${BASE_URL}/sections/${sectionId}/current`
);
console.log('API 응닡:', response);

// 응닡이 λΉ„μ–΄μžˆκ±°λ‚˜ next_num이 0인 경우, λŒ€κΈ° 쀑인 첫 번째 방문을 쑰회
if (!response.next_num) {
try {
const pendingVisit = await apiCall.get(
`${BASE_URL}/sections/${sectionId}/current`
);
console.log('λŒ€κΈ° 쀑인 첫 번째 λ°©λ¬Έ:', pendingVisit);

if (pendingVisit && pendingVisit.data) {
// data 객체 확인
Expand Down
1 change: 0 additions & 1 deletion src/api/customer/inquires.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export const postInquiry = async ({
category,
content,
}: PostInquiryRequest) => {
console.log(content);
return (await apiCall.post(BASE_URL, {
category,
content,
Expand Down
4 changes: 0 additions & 4 deletions src/components/Admin/WaitingNum.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ function WaitingNumber({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [rotateAngle]);

useEffect(() => {
console.log(...numbers);
}, [numbers]);

return (
<div className='mt-10 flex w-full flex-col items-center rounded-lg bg-white pb-[4.25rem]'>
<div className='mb-[-5rem] flex w-full max-w-xl justify-between px-2 md:px-8'>
Expand Down
2 changes: 0 additions & 2 deletions src/components/Admin/customer/CustomerContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ function CustomerContainer() {
);
}

console.log(customers.data);

// 이전 νŽ˜μ΄μ§€
const onPrev = () => {
const prevPage = currentPage - 1 > 0 ? currentPage - 1 : 1;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Admin/main/CallContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function CallContainer() {

const handleWebSocketMessage = useCallback(
(message: { type: 'UPDATE_NEEDED'; topicId: number }) => {
console.log('μ›Ήμ†ŒμΌ“ λ©”μ‹œμ§€ μˆ˜μ‹  - μƒνƒœ μ—…λ°μ΄νŠΈ ν•„μš”:', message);
console.debug('μ›Ήμ†ŒμΌ“ λ©”μ‹œμ§€ μˆ˜μ‹  - μƒνƒœ μ—…λ°μ΄νŠΈ ν•„μš”:', message);

refetch();
},
Expand All @@ -45,7 +45,7 @@ function CallContainer() {
const { isConnected } = useWebSocket(1, 'CALL', handleWebSocketMessage);

useEffect(() => {
console.log('μ „ν™” νŽ˜μ΄μ§€ 마운트, μ›Ήμ†ŒμΌ“ μ—°κ²° μƒνƒœ:', isConnected);
console.debug('μ „ν™” νŽ˜μ΄μ§€ 마운트, μ›Ήμ†ŒμΌ“ μ—°κ²° μƒνƒœ:', isConnected);
refetch();
}, [isConnected, refetch]);

Expand Down
6 changes: 1 addition & 5 deletions src/components/Admin/main/CallInfoBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ function CallInfoBox({
);
}

const { id, waiting_num, category, tags, content, memo } = selectedCall;

if (tags) {
console.log(tags);
}
const { id, waiting_num, category, content, memo } = selectedCall;

const { auth_id, customer_name, phone_number, birth_date } = customerDetail;

Expand Down
2 changes: 0 additions & 2 deletions src/components/Admin/main/CurrentBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ function CurrentBox({
customer_id,
} = progress;

console.log(progress);

const { data: customerDetail } = useGetCustomerDetail(customer_id ?? 0);
const { data: customerHistory } = useGetCustomerHistory(customer_id ?? 0);

Expand Down
2 changes: 0 additions & 2 deletions src/components/Direction/TopSheet/DepartureArrivalTime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ export default function DepartureArrivalTime() {
departureTime.getSeconds() + +(totalTime / 60).toFixed(0) * 60
);
setArrivalTime(tmpTime);
console.log('πŸš€ ~ TopSheet ~ departureTime:', departureTime);
console.log('πŸš€ ~ TopSheet ~ arrivalTime:', arrivalTime);

// eslint-disable-next-line react-hooks/exhaustive-deps
}, [routesPedestrainResponse, routesAutomobileResponse, routesType]);
Expand Down
1 change: 0 additions & 1 deletion src/components/Direction/TopSheet/TotalTime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export default function TotalTime() {
? routesAutomobileResponse
: routesPedestrainResponse) || { totalTime: 0 };

console.log(totalTime);
return (
<div className='flex items-end gap-3'>
<div>μ†Œμš”μ‹œκ°„</div>
Expand Down
19 changes: 1 addition & 18 deletions src/hooks/map-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export const MapProvider = ({
return;
}
mapInstance.on('Click', () => {
console.log('Map Clicked!!!!');
console.debug('Map Clicked!!!!');
setMapFocusOnly((cur) => !cur);
});
}, [mapInstance, setMapFocusOnly]);
Expand Down Expand Up @@ -229,10 +229,6 @@ export const MapProvider = ({
// // eslint-disable-next-line react-hooks/exhaustive-deps
// }, [mapInstance]);

useEffect(() => {
console.log(coords);
}, [mapInstance, coords]);

// λ³΄ν–‰μž 경둜 및 μ‹œκ°„, 거리 정보 μ„€μ •ν•˜κΈ°
useEffect(() => {
if (!pedestrainResponse) {
Expand Down Expand Up @@ -285,15 +281,13 @@ export const MapProvider = ({
);

const setStartCoord = (latitude: number, longitude: number) => {
console.log('setStartCoord');
dispatchRoutesData({
type: 'setStartCoord',
payload: new Tmapv3.LatLng(latitude, longitude),
});
};

const setEndCoord = (latitude: number, longitude: number) => {
console.log('setEndCoord');
dispatchRoutesData({
type: 'setEndCoord',
payload: new Tmapv3.LatLng(latitude, longitude),
Expand Down Expand Up @@ -397,7 +391,6 @@ export const MapProvider = ({
// 은행 마컀 생성
useEffect(() => {
const onClickMarker = (id: string) => {
console.log(id);
if (selectedBranchId !== id) setSelectedBranchId(id);
};

Expand Down Expand Up @@ -435,7 +428,6 @@ export const MapProvider = ({
y_position: latitude,
}) => {
if (mapInstance && latitude && longitude) {
console.log(name);
const position = new Tmapv3.LatLng(+latitude, +longitude);
const marker = Marker({
mapContent: mapInstance,
Expand Down Expand Up @@ -501,15 +493,6 @@ export const MapProvider = ({
}, 1000);

if (routesType === 'initial') {
const date = new Date();
console.log(
'SET TIMEOUT!!!!!!!!!',
date.getMinutes(),
date.getSeconds(),
date.getMilliseconds()
);
console.log(routesData);
console.log(mapInstance);
setPolyline();
}

Expand Down
1 change: 0 additions & 1 deletion src/hooks/query/admin/usePatchCallProgress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const usePatchCallProgress = () => {
mutationKey: [ADMIN_QUERY_KEYS.CALL_PROGRESS],
mutationFn: patchCallProgress,
onSuccess: (response) => {
console.log(response);
showToast(toast, `${response}번 상담이 μ‹œμž‘λ˜μ—ˆμŠ΅λ‹ˆλ‹€.`);
queryClient.invalidateQueries({
queryKey: [ADMIN_QUERY_KEYS.CALL_WAIT_LIST],
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/query/customer/useDeleteCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const useDeleteCall = () => {
mutationKey: [QUERY_KEYS.CALL_DEL],
mutationFn: deleteCall,
onSuccess: ({ call_id }) => {
console.log(call_id);
console.debug(call_id);
showToast(toast, 'μ·¨μ†Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€.');
setTimeout(() => {
navigate(CUSTOMER_ROUTE.reservation.call);
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/query/customer/useDeleteInquiry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const useDeleteInquiry = () => {
mutationKey: [QUERY_KEYS.INQUIRY_DEL],
mutationFn: deleteInquiry,
onSuccess: ({ inquiry_id }) => {
console.log(inquiry_id);
console.debug(inquiry_id);
showToast(toast, 'μ·¨μ†Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€.');
setTimeout(() => {
navigate(CUSTOMER_ROUTE.reservation.inquiry);
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/query/customer/useDeleteVisit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const useDeleteVisit = () => {
mutationKey: [QUERY_KEYS.VISIT_DEL],
mutationFn: deleteVisit,
onSuccess: ({ visit_id }) => {
console.log(visit_id);
console.debug(visit_id);
showToast(toast, 'μ·¨μ†Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€.');
setTimeout(() => {
navigate(CUSTOMER_ROUTE.reservation.visit);
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/query/customer/usePostCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const usePostCall = () => {
mutationKey: [QUERY_KEYS.CALL_ADD],
mutationFn: postCall,
onSuccess: ({ call_id }) => {
console.log(call_id);
console.debug(call_id);
showToast(toast, 'μ˜ˆμ•½ μ™„λ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€!');
setContent('');
setTimeout(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/query/customer/usePostInquiry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const usePostInquiry = () => {
mutationKey: [QUERY_KEYS.INQUIRY_ADD],
mutationFn: postInquiry,
onSuccess: ({ inquiry_id }) => {
console.log(inquiry_id);
console.debug(inquiry_id);
showToast(toast, 'μ˜ˆμ•½ μ™„λ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€!');
setContent('');
setTimeout(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/query/customer/usePostRecommendList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const usePostRecommendList = () => {
mutationKey: [QUERY_KEYS.RECOMMEND],
mutationFn: PostRecommendList,
onSuccess: ({ recommends, tags }: PostRecommendListResponse) => {
console.log(recommends);
console.debug(recommends);
setRecommendList(recommends);
setTagList(tags);
setIsLoading(false);
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/query/customer/usePostSignUp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const usePostSignUp = () => {
mutationKey: [QUERY_KEYS.SIGN_UP],
mutationFn: postSignUp,
onSuccess: ({ message }) => {
console.log(message);
console.debug(message);
showToast(toast, 'νšŒμ›κ°€μž…μ— μ„±κ³΅ν•˜μ˜€μŠ΅λ‹ˆλ‹€!');
navigate(CUSTOMER_ROUTE.signin);
},
Expand Down
24 changes: 12 additions & 12 deletions src/hooks/useWebSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ export const useWebSocket = (
const connect = useCallback(() => {
try {
if (isConnecting.current) {
console.log('μ—°κ²° μ‹œλ„ μ€‘μž…λ‹ˆλ‹€...');
console.debug('μ—°κ²° μ‹œλ„ μ€‘μž…λ‹ˆλ‹€...');
return;
}

if (webSocket.current?.readyState === WebSocket.OPEN) {
console.log('이미 μ—°κ²°λœ μ›Ήμ†ŒμΌ“μ΄ μžˆμŠ΅λ‹ˆλ‹€.');
console.debug('이미 μ—°κ²°λœ μ›Ήμ†ŒμΌ“μ΄ μžˆμŠ΅λ‹ˆλ‹€.');
return;
}

isConnecting.current = true;
console.log(`μ›Ήμ†ŒμΌ“ μ—°κ²° μ‹œλ„... topicId: ${topicId}`);
console.debug(`μ›Ήμ†ŒμΌ“ μ—°κ²° μ‹œλ„... topicId: ${topicId}`);
webSocket.current = new WebSocket(`${BASE_URL}/ws/test`);

webSocket.current.onopen = () => {
console.log('μ›Ήμ†ŒμΌ“ μ—°κ²° 성곡!');
console.debug('μ›Ήμ†ŒμΌ“ μ—°κ²° 성곡!');
isConnecting.current = false;

// μ—°κ²° 직후 λ°”λ‘œ ꡬ독 λ©”μ‹œμ§€ 전솑
Expand All @@ -42,7 +42,7 @@ export const useWebSocket = (
action: 'subscribe',
topicId: String(topicId),
});
console.log('ꡬ독 λ©”μ‹œμ§€ 전솑:', subscribeMessage);
console.debug('ꡬ독 λ©”μ‹œμ§€ 전솑:', subscribeMessage);
webSocket.current.send(subscribeMessage);
} catch (error) {
console.error('ꡬ독 λ©”μ‹œμ§€ 전솑 μ‹€νŒ¨:', error);
Expand All @@ -51,14 +51,14 @@ export const useWebSocket = (
};

webSocket.current.onmessage = (event: MessageEvent) => {
console.log('μ›Ήμ†ŒμΌ“ λ©”μ‹œμ§€ 원본:', event.data);
console.debug('μ›Ήμ†ŒμΌ“ λ©”μ‹œμ§€ 원본:', event.data);

try {
if (
event.data === 'μ›Ήμ†ŒμΌ“ μ—°κ²° 성곡' ||
event.data.includes('ꡬ독 μ™„λ£Œ')
) {
console.log('μ‹œμŠ€ν…œ λ©”μ‹œμ§€:', event.data);
console.debug('μ‹œμŠ€ν…œ λ©”μ‹œμ§€:', event.data);
return;
}

Expand All @@ -73,15 +73,15 @@ export const useWebSocket = (
topicId: sectionId,
});
} else {
console.log('μ•Œ 수 μ—†λŠ” λ©”μ‹œμ§€ ν˜•μ‹:', event.data);
console.debug('μ•Œ 수 μ—†λŠ” λ©”μ‹œμ§€ ν˜•μ‹:', event.data);
}
} catch (error) {
console.error('λ©”μ‹œμ§€ 처리 쀑 μ—λŸ¬:', error);
}
};

webSocket.current.onclose = (event) => {
console.log('μ›Ήμ†ŒμΌ“ μ—°κ²° μ’…λ£Œ:', {
console.debug('μ›Ήμ†ŒμΌ“ μ—°κ²° μ’…λ£Œ:', {
code: event.code,
reason: event.reason,
wasClean: event.wasClean,
Expand All @@ -90,12 +90,12 @@ export const useWebSocket = (
isConnecting.current = false;

if (!event.wasClean) {
console.log('비정상 μ’…λ£Œλ‘œ μΈν•œ μž¬μ—°κ²° μ‹œλ„ μ˜ˆμ •...');
console.debug('비정상 μ’…λ£Œλ‘œ μΈν•œ μž¬μ—°κ²° μ‹œλ„ μ˜ˆμ •...');
if (reconnectTimeoutRef.current) {
window.clearTimeout(reconnectTimeoutRef.current);
}
reconnectTimeoutRef.current = window.setTimeout(() => {
console.log('μ›Ήμ†ŒμΌ“ μž¬μ—°κ²° μ‹œλ„...');
console.debug('μ›Ήμ†ŒμΌ“ μž¬μ—°κ²° μ‹œλ„...');
connect();
}, 3000);
}
Expand All @@ -121,7 +121,7 @@ export const useWebSocket = (
window.clearTimeout(reconnectTimeoutRef.current);
}
if (webSocket.current) {
console.log('μ›Ήμ†ŒμΌ“ μ—°κ²° 정리 쀑...');
console.debug('μ›Ήμ†ŒμΌ“ μ—°κ²° 정리 쀑...');
webSocket.current.close(1000, '정상 μ’…λ£Œ');
webSocket.current = null;
}
Expand Down
Loading

0 comments on commit 35f8663

Please sign in to comment.