Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 서버 주소 추가 및 서버가 주는 정보에 맞춰 코드 변경한다 #163

Merged
merged 6 commits into from
Jul 21, 2023

Conversation

feb-dain
Copy link
Collaborator

@feb-dain feb-dain commented Jul 21, 2023

📄 Summary

서버 주소 추가 및 서버가 주는 정보에 맞춰 코드 변경한다

  • 서버 주소 추가
  • 서버가 주는 정보에 맞춰서 코드 변경
  • 잘못된 데이터 null 값으로 변경

🙋🏻 More

실제 소요 시간: 50분

close #160

@feb-dain feb-dain added 🛠️ 리팩터링 개선사항입니다 FE 프론트엔드 관련 이슈입니다 🫱🏻‍🫲🏻 페어 페어로 진행합니다 labels Jul 21, 2023
@feb-dain feb-dain requested a review from kyw0716 as a code owner July 21, 2023 04:47
@feb-dain feb-dain self-assigned this Jul 21, 2023
Copy link
Member

@gabrielyoon7 gabrielyoon7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굿샷

const data: StationDetails = await response.json();

const changedDataList = Object.entries(data).map(([key, value]) => {
if (INVALID_VALUE_LIST.includes(value)) value = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

중괄호 어디감

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

습니까?

const data: StationDetails = await response.json();

const changedDataList = Object.entries(data).map(([key, value]) => {
if (INVALID_VALUE_LIST.includes(value)) value = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (INVALID_VALUE_LIST.includes(value)) value = null;
if (INVALID_VALUE_LIST.includes(value)) {
return [key, null];
}

요게 더 좋지 않을까 하는 생각입니다!

Copy link
Member

@kyw0716 kyw0716 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

야미: 가브리엘은 이상한 사람이다

method: 'GET',
}).then<StationDetails>((response) => {
}).then<StationDetails>(async (response) => {
if (!response.ok) {
throw new Error('[error] 충전소 세부 정보를 불러올 수 없습니다.');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

상수로 분리해주세요

@feb-dain feb-dain merged commit 75cfe33 into develop Jul 21, 2023
@feb-dain feb-dain deleted the refactor/160 branch July 21, 2023 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FE 프론트엔드 관련 이슈입니다 🛠️ 리팩터링 개선사항입니다 🫱🏻‍🫲🏻 페어 페어로 진행합니다
Projects
None yet
Development

Successfully merging this pull request may close these issues.

서버 주소 추가 및 서버가 주는 정보에 맞춰 코드 변경한다
4 participants