Skip to content

Commit

Permalink
refactor: msw 모킹을 위한 리뷰 데이터 하드코딩
Browse files Browse the repository at this point in the history
Co-Authored-By: ImxYJL <[email protected]>
  • Loading branch information
soosoo22 and ImxYJL committed Jul 25, 2024
1 parent 13ebfa3 commit c43bcee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/src/mocks/handlers/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { REVIEW_PREVIEW_LIST } from '../mockData/reviewPreviewList';
import { REVIEW_WRITING_DATA } from '../mockData/reviewWritingData';

const getDetailedReview = () =>
http.get(endPoint.gettingDetailedReview(0, 1), async ({ request }) => {
http.get(endPoint.gettingDetailedReview(123456, 123456), async ({ request }) => {
return HttpResponse.json(DETAILED_REVIEW_MOCK_DATA);
});

Expand Down
7 changes: 4 additions & 3 deletions frontend/src/pages/ReviewPreviewListPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import SearchSection from './components/SearchSection';
import * as S from './styles';

const USER_SEARCH_PLACE_HOLDER = '레포지토리명을 검색하세요.';
const options = ['최신순', '오래된순'];
const OPTIONS = ['최신순', '오래된순'];

const ReviewPreviewListPage = () => {
const [reviews, setReviews] = useState<ReviewPreview[]>([]);
Expand All @@ -34,13 +34,14 @@ const ReviewPreviewListPage = () => {
}, []);

const handleReviewClick = (id: number) => {
navigate(`/user/detailed-review/${id}?memberId=${4}`);
//navigate(`/user/detailed-review/${id}?memberId=${4}`);
navigate(`/user/detailed-review/${123456}?memberId=${123456}`); // NOTE: MSW용 하드코딩
};

return (
<>
<S.Layout>
<SearchSection onChange={() => {}} options={options} placeholder={USER_SEARCH_PLACE_HOLDER} />
<SearchSection onChange={() => {}} options={OPTIONS} placeholder={USER_SEARCH_PLACE_HOLDER} />
<S.ReviewSection>
{loading && <p>로딩 중...</p>}
{error && <p>{error}</p>}
Expand Down

0 comments on commit c43bcee

Please sign in to comment.