Skip to content

[3주차/유징] 워크북 제출합니다. - #30

Merged
using2 merged 9 commits into
UMC-Inha:유징/mainfrom
using2:main
Oct 6, 2025
Merged

using2 merged 9 commits into
UMC-Inha:유징/mainfrom
using2:main

Conversation

@using2

@using2 using2 commented Sep 30, 2025 •

Copy link
Copy Markdown

✅ 워크북 체크리스트

  • 모든 핵심 키워드 정리를 마쳤나요?
  • 핵심 키워드에 대해 완벽히 이해하셨나요?
  • 이론 학습 이후 직접 실습을 해보는 시간을 가졌나요?
  • 미션을 수행하셨나요?
  • 미션을 기록하셨나요?

✅ 컨벤션 체크리스트

  • 디렉토리 구조 컨벤션을 잘 지켰나요?
  • pr 제목을 컨벤션에 맞게 작성하였나요?
  • pr에 해당되는 이슈를 연결하였나요?(중요)
  • 적절한 라벨을 설정하였나요?
  • 파트장에게 code review를 요청하기 위해 reviewer를 등록하였나요?
  • 닉네임/main 브랜치의 최신 상태를 반영하고 있는지 확인했나요?(매우 중요!)

📌 주안점

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}`;
}

@wupe1001 wupe1001 Oct 3, 2025 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

저는 바로 URL를 받아 와서 해당 값이 없을 때의 null값 처리를 못했었는데 이런 식으로 함수를 설정해서 타입 명시랑 null값 지정도 할 수 있었네요 ! 또 타입과 null값 처리 덕분에 코드가 읽기 편한 것 같아요 !

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;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

이전 스터디 시간에 말씀해 주셨던 인터셉터를 활용하여 모든 요청에 Authorization 헤더를 동적으로 추가하는 방식이 인상적이구 좋은 것 같습니다 !! 너무 좋은 코든데 굳이 굳이 추가해 보자면 TS 를 사용하고 있으니, import.meta.env의 타입 안전성을 높이기 위해 vite-env.d.ts 같은 파일을 통해 타입을 명시적으로 정의해 보는 것도 좋을 것 같습니당 !!

useEffect((): void => {
const fetchMovie = async (): Promise<void> => {
setIsPending(true);
try {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

참고로, fetchMovie와 fetchCredit을 각각 호출하기보다는 Promise.allSettled로 한 번에 관리하면 로딩 상태와 에러 처리를 더 간단하게 해볼 수 있습니다. 이 방식으로 처리하면 detail 데이터가 실패했을 때는 전체 에러로 처리하고, credits는 실패 시 "credit 정보를 불러올 수 없습니다." 같은 부분 실패 UI로 대체하여 UI/UX 개선에도 도움이 될 것 같아요

@sunnyinha

Copy link
Copy Markdown
Collaborator

유징, 3주차도 수고하셨습니다! 머지해주세요~

@using2
using2 merged commit 135f6e2 into UMC-Inha:유징/main Oct 6, 2025
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.

Chapter03_부드럽고 강력한 웹앱 만들기: Tailwind CSS, React Router, API 통신

4 participants