Skip to content

[Refactor] #100 - Refactoring snake_case to camelCase#101

Open
shimseohyun wants to merge 3 commits into
developfrom
refactor/#100
Open

[Refactor] #100 - Refactoring snake_case to camelCase#101
shimseohyun wants to merge 3 commits into
developfrom
refactor/#100

Conversation

@shimseohyun
Copy link
Copy Markdown
Contributor

@shimseohyun shimseohyun commented Dec 8, 2024

🔥 Pull requests

👷 작업한 내용

  • snake case로 작업된 변수명을 camelCase로 변환합니다.

🚨 참고 사항

현재 run build로 에러 안 나는 것만 확인했어요.
서버 돌리면 어떤 일이 일어날지 모름...

🖥️ 주요 코드 설명

booth, waiting interface 생성

자주 사용하는 데이터 구조인 boothwaiting의 interface를 생성했습니다.
해당 데이터를 사용하는 경우 props로 받아서 사용해주시면 돼요.

  • Waiting Card에서 Waiting 데이터를 사용합니다.
interface WaitingCardProps {
  waiting: Pick<
    Waiting,
    | "waitingID"
    | "waitingTeamsAhead"
    | "booth"
    | "partySize"
    | "waitingStatus"
    | "confirmDueTime"
    | "arrivalarrivalDueTime"
  >;
  isButton?: boolean;
  disableClick?: boolean;
}

const WaitingCard = ({ waiting, disableClick = false }: WaitingCardProps) => {

✅ Check List

  • Merge 대상 브랜치가 올바른가?
  • 최종 코드가 에러 없이 잘 동작하는가? -> build 에러 없음 확인
  • 전체 변경사항이 500줄을 넘지 않는가?

📟 관련 이슈

Copy link
Copy Markdown
Contributor

@sayyyho sayyyho left a comment

Choose a reason for hiding this comment

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

snake 케이스 camel 케이스로 변경하시느라 고생하셨어요!! 웹을 잠깐 쉬다가 보니까 낯설었지만, 공부하면서 잘 봤습니다ㅎㅎ 다시 리팩 레츠고 하시져!~!

Comment on lines +37 to +51
extends Array<{
id: number;
name: string;
description: string;
location: string;

is_operated: BoothStatus;
thumbnail: string;

waiting_count: number;
total_waiting_teams: number;

is_waiting: boolean;
waiting_status: WaitingStatus | null;
}> {}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Array 확장해서 쓰는 방식 좋네요!

Comment on lines +68 to +76
openTime: response.open_time,
closeTime: response.close_time,
waitingCount: response.waiting_count,
isWaiting: response.is_waiting,
waitingStatus: response.waiting_status,
isOperated: response.is_operated,
waitingID: response.waiting_id,
totalWaitingTeams: response.total_waiting_teams,
waitingTeamsAhead: response.waiting_teams_ahead,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good

Comment on lines 81 to +89
export const postWaitingRegister = async ({
boothId,
party_size,
}: RegisterWaitingRequest): Promise<PostWaitingRegisterProps | null> => {
const response = await postResponse<PostWaitingRegisterProps>(
`api/v1/waitings/${boothId}/register`,
{ party_size }
);
...props
}: RegisterWaitingRequest): Promise<PostWaitingRegisterResponse | null> => {
const response = await postResponseNew<
PostWaitingRegisterBody,
PostWaitingRegisterResponse
>(`api/v1/waitings/${props.boothID}/register`, {
party_size: props.partySize,
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

변경 방식 마음에 드네요!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

프사가 멋지시네요

@sayyyho sayyyho requested a review from ohchanju3 February 20, 2025 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] Refactoring snake_case to camelCase

2 participants