Repository navigation
[3주차/유징] 워크북 제출합니다. - #30
Merged
Merged
Conversation
wupe1001
reviewed
Oct 3, 2025
Comment on lines
+18
to
+21
| export function buildImageUrl(path: string | null, size: "w500" | "original" = "w500"): string | null { | ||
| if (!path) return null; | ||
| return `https://image.tmdb.org/t/p/${size}${path}`; | ||
| } |
There was a problem hiding this comment.
저는 바로 URL를 받아 와서 해당 값이 없을 때의 null값 처리를 못했었는데 이런 식으로 함수를 설정해서 타입 명시랑 null값 지정도 할 수 있었네요 ! 또 타입과 null값 처리 덕분에 코드가 읽기 편한 것 같아요 !
qkrdmsthff
reviewed
Oct 3, 2025
| import axios, { AxiosError } from "axios"; | ||
|
|
||
| const API_BASE_URL = import.meta.env.VITE_API_BASE_URL; | ||
| const TMDB_TOKEN = import.meta.env.VITE_TMDB_KEY; |
Member
There was a problem hiding this comment.
이전 스터디 시간에 말씀해 주셨던 인터셉터를 활용하여 모든 요청에 Authorization 헤더를 동적으로 추가하는 방식이 인상적이구 좋은 것 같습니다 !! 너무 좋은 코든데 굳이 굳이 추가해 보자면 TS 를 사용하고 있으니, import.meta.env의 타입 안전성을 높이기 위해 vite-env.d.ts 같은 파일을 통해 타입을 명시적으로 정의해 보는 것도 좋을 것 같습니당 !!
sunnyinha
reviewed
Oct 3, 2025
| useEffect((): void => { | ||
| const fetchMovie = async (): Promise<void> => { | ||
| setIsPending(true); | ||
| try { |
Collaborator
There was a problem hiding this comment.
참고로, fetchMovie와 fetchCredit을 각각 호출하기보다는 Promise.allSettled로 한 번에 관리하면 로딩 상태와 에러 처리를 더 간단하게 해볼 수 있습니다. 이 방식으로 처리하면 detail 데이터가 실패했을 때는 전체 에러로 처리하고, credits는 실패 시 "credit 정보를 불러올 수 없습니다." 같은 부분 실패 UI로 대체하여 UI/UX 개선에도 도움이 될 것 같아요
sunnyinha
approved these changes
Oct 5, 2025
Collaborator
|
유징, 3주차도 수고하셨습니다! 머지해주세요~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✅ 워크북 체크리스트
✅ 컨벤션 체크리스트
📌 주안점