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

fix: 7.4.4-2 예제코드 오류 수정 #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BangDori
Copy link

안녕하세요. 도서에 나온 코드를 확인하다가, 예제 코드가 다른 부분이 있어 수정하였습니다.

수정사항

앞선 코드에서 MockResult의 타입이 다음과 같이 정의되어 있었는데, fetchOrderListMock 메서드의 인자로 받아오는 매개변수의 타입이 잘못되어 있어 수정하였습니다.

interface MockResult {
  status?: number;
  delay?: number;
  use?: boolean;
}

수정 전

export const fetchOrderListMock = ({
  status = 200,
  time = 100, // 🚨
  use = true,
}: MockResult) =>
  use &&
  mock
    .onGet(/\/order\/list/)
    .reply(() =>
      lazyData(status, fetchOrderListSuccessResponse, undefined, time) // 🚨
    );

수정 후

export const fetchOrderListMock = ({
  status = 200,
  delay = 100,
  use = true,
}: MockResult) =>
  use &&
  mock
    .onGet(/\/order\/list/)
    .reply(() =>
      lazyData(status, fetchOrderListSuccessResponse, undefined, delay)
    );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant