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

구현 - 상영중인 영화 리뷰 리스트 API 라우트 추가 #27

Merged
merged 11 commits into from
Oct 22, 2024

Conversation

ag502
Copy link
Collaborator

@ag502 ag502 commented Oct 6, 2024

PR 타입

  • 기능 추가
  • 버그 수정
  • 의존성, 환경 변수, 빌드 관련 코드 업데이트
  • 문서 수정
  • 기타

연관 이슈

resolve #25

개요

현재 상영중인 영화 리뷰 API 추가

변경 사항

  • 상영중인 영화 리뷰 API 라우트 추가
  • 클라이언트/서버 API 엔드 포인트 분리
  • 상영중인 영화 리뷰 API 요청 코드 및 react-query 추가

리뷰시 참고할 사항

@ag502 ag502 added the feature label Oct 6, 2024
@ag502 ag502 requested a review from f-lab-james October 6, 2024 10:47
@ag502 ag502 self-assigned this Oct 6, 2024
Copy link

sonarqubecloud bot commented Oct 6, 2024

[],
);

res.status(200).send({ page: Number(page), results: nowPlayingMovieReviews });

Choose a reason for hiding this comment

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

try 안에 있는 내용을 안에 고차함수로 넣고 메서드, 스키마를 넣으면 405, 422, 500 에러를 공통으로 처리하면 좋을 것 같습니다.

const querySchema = z.object({
  page: z.string(),
  query: z.number(),
  region: z.string()
});

type Query = z.infer<typeof querySchema>;

withCommonHandler(() => {
}, HTTPMethod.GET,  querySchema)

{ language, region, page }: NowPlayingMovieListReviewsParams = { language: "ko-KR", region: "KR", page: 1 },
) => {
return useQuery({
queryKey: [...reviewsQueryKeys.nowPlayingMovieList({ language, region, page })],

Choose a reason for hiding this comment

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

Suggested change
queryKey: [...reviewsQueryKeys.nowPlayingMovieList({ language, region, page })],
queryKey: reviewsQueryKeys.nowPlayingMovieList({ language, region, page }),

import { ReviewAuthorModel } from "./review-author";

export class NowPlayingMovieReviewModel {
movieId: number;

Choose a reason for hiding this comment

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

tsdoc 달아두면 나중에 IDE에 도움을 받을 수 있어서 편리합니다.

@ag502 ag502 merged commit fcb9be1 into develop Oct 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] 상영중인 영화 리뷰 리스트 API 라우트 추가
2 participants