From 46e413711fbc966d81b416c264c68eef47c06711 Mon Sep 17 00:00:00 2001 From: "Gabriel Ju Hyun, Yoon" Date: Fri, 18 Aug 2023 02:04:19 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=9E=98=EB=AA=BB=EB=90=9C=20?= =?UTF-8?q?=ED=95=84=ED=84=B0=EB=A7=81=EC=9D=84=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=ED=95=98=EA=B3=A0=20UX=EC=9D=84=20=EA=B0=9C=EC=84=A0=ED=95=9C?= =?UTF-8?q?=EB=8B=A4=20(#591)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 잘못된 필터링 제거 [#588] * refactor: 불필요한 출력문 제거 [#588] * refactor: 비로그인자의 토큰 전달 시도를 막도록 하는 기능 구현 [#588] * refactor: 충전기 혼잡도 그룹 순서 변경 [#588] --- .../components/google-maps/map/CarFfeineMap.tsx | 2 +- .../congestion/CongestionStatistics.tsx | 12 ++++++------ .../station/StationInformation.tsx | 6 ++---- .../reports/useStationChargerReport.ts | 14 ++++++++++---- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/google-maps/map/CarFfeineMap.tsx b/frontend/src/components/google-maps/map/CarFfeineMap.tsx index 039371ecd..9352438ec 100644 --- a/frontend/src/components/google-maps/map/CarFfeineMap.tsx +++ b/frontend/src/components/google-maps/map/CarFfeineMap.tsx @@ -49,7 +49,7 @@ const CarFfeineMapListener = () => { const queryClient = useQueryClient(); const debouncedIdleHandler = debounce(() => { - console.log('idle (테스트용: 제거 예정)'); + // console.log('idle (테스트용: 제거 예정)'); if (googleMap.getZoom() < INITIAL_ZOOM_SIZE) { toastActions.showToast('지도를 조금만 더 확대해주세요', 'warning', 'bottom-center'); } diff --git a/frontend/src/components/ui/StationDetailsWindow/congestion/CongestionStatistics.tsx b/frontend/src/components/ui/StationDetailsWindow/congestion/CongestionStatistics.tsx index 1e9268daf..89ec6002b 100644 --- a/frontend/src/components/ui/StationDetailsWindow/congestion/CongestionStatistics.tsx +++ b/frontend/src/components/ui/StationDetailsWindow/congestion/CongestionStatistics.tsx @@ -38,20 +38,20 @@ const CongestionStatistics = ({ stationId }: CongestionStatisticsProps) => { /> setChargingSpeed('quick')} + onClick={() => setChargingSpeed('standard')} fullWidth > - 급속 충전기 그룹 + 완속 충전기 그룹 setChargingSpeed('standard')} + onClick={() => setChargingSpeed('quick')} fullWidth > - 완속 충전기 그룹 + 급속 충전기 그룹 diff --git a/frontend/src/components/ui/StationDetailsWindow/station/StationInformation.tsx b/frontend/src/components/ui/StationDetailsWindow/station/StationInformation.tsx index 6cc738349..d76dae5b2 100644 --- a/frontend/src/components/ui/StationDetailsWindow/station/StationInformation.tsx +++ b/frontend/src/components/ui/StationDetailsWindow/station/StationInformation.tsx @@ -32,12 +32,10 @@ const StationInformation = ({ station }: StationInformationProps) => { {stationName} - {contact?.length > 0 || !address || address === 'null' ? '주소 미확인' : address} + {!address || address?.length === 0 ? '주소 미확인' : address} - {contact?.length > 0 || !address || detailLocation === 'null' - ? '상세주소 미확인' - : detailLocation} + {!detailLocation || detailLocation?.length === 0 ? '상세주소 미확인' : detailLocation} diff --git a/frontend/src/hooks/tanstack-query/station-details/reports/useStationChargerReport.ts b/frontend/src/hooks/tanstack-query/station-details/reports/useStationChargerReport.ts index ff3768ece..ae72b3a5b 100644 --- a/frontend/src/hooks/tanstack-query/station-details/reports/useStationChargerReport.ts +++ b/frontend/src/hooks/tanstack-query/station-details/reports/useStationChargerReport.ts @@ -9,13 +9,19 @@ import { QUERY_KEY_STATION_CHARGER_REPORT } from '@constants/queryKeys'; const fetchStationChargerReport = (stationId: string) => { const mode = serverStore.getState(); const memberToken = memberTokenStore.getState(); + const headers = + memberToken === '' + ? { + 'Content-Type': 'application/json', + } + : { + Authorization: `Bearer ${memberToken}`, + 'Content-Type': 'application/json', + }; return fetch(`${SERVERS[mode]}/stations/${stationId}/reports/me`, { method: 'GET', - headers: { - Authorization: `Bearer ${memberToken}`, - 'Content-Type': 'application/json', - }, + headers: headers, }).then(async (response) => { const data = await response.json(); return data.isReported;