κ° μ€ν μ΄μ§μμμ κ²½νμ λ°νμΌλ‘ μ±μ₯ν΄κ°λ μ΄μΌκΈ°μ λλ€.
μ±ν° 1 μμμ νΈλ¬λΈμν λ₯λ ₯κ³Ό Special Stageμ κΈ°μ μ λμ μ κ²½νμ λ°νμΌλ‘ λ μ¨ κΈ°λ° μΊ νμ₯ μΆμ² μλΉμ€λ₯Ό λμμ΄λ, λ°±μλ νκ³Ό ν¨κ» λ§λ€μ΄ μ μ λ₯Ό μ μΉν΄κ°λ κ³Όμ μμ μκΈ΄ μ΄μΌκΈ°μ λλ€.
CampUs λ 곡곡λ°μ΄ν° API μ€ GoCamping APIλ₯Ό λ°±μλμμ 3000μ¬ κ°μ μΊ νμ₯ λ°μ΄ν°λ₯Ό λ°μ ν μλΉμ€μμ μ¬μ©ν μ μλ λ°μ΄ν°λ‘ κ°κ³΅ λ° μ λ ¬νμ¬ κ·Έκ²μ νλ‘ νΈμμ μ¬μ©νκ³ μμ΅λλ€.
API λͺ μΈμμμ λμμλ κ°μ²΄λ°°μ΄ ꡬ쑰λ₯Ό νμ νμ¬ interfaceλ₯Ό λ§λ€μ΄ λ°μ΄ν°λ€μ νμ λ€μ 미리 μ§μ μ νκ³ λ°°μ΄ depth λ° λ°μ΄ν° νμμ λ§κ² μ€μ μ νμμ΅λλ€. κ·Έλ κ² ν΄μ μΊ νμ₯ λ°μ΄ν°λ₯Ό μ λ°μμ λ λλ§μ ꡬμΆνλλ° μ±κ³΅μ νμμ΅λλ€.
// κ°μ²΄λ°°μ΄μ λ§κ² μμ±λ μΈν°νμ΄μ€
export interface IGetCampResult {
ImageUrl: string;
X: string;
Y: string;
address: string;
animal: string;
campId: number;
campName: string;
clturEvent: string;
createdtime: string;
doNm: string;
status: boolean;
eqpmnLendCl: string;
featureNm: string;
homePage: string;
induty: string;
lookUp: number;
manageSttus: string;
operDeCl: string;
operPdCl: string;
pickCount: number;
posblFcltyCl: string;
reviewCount: number;
sbrsCl: string;
sigunguNm: string;
swrmCo: string;
themaEnvrnCl: string;
toiletCo: string;
wtrplCo: string;
look: IGetCampResult;
review: IGetCampResult;
pick: IGetCampResult;
camp: IGetCampResult[];
distance: number;
/* toast */
toastState?: boolean;
setToastState?: React.Dispatch<React.SetStateAction<boolean>>;
}
export interface campArray extends IGetCampResult {
currentPage: number;
total: number;
topicCamp: IGetCampResult[];
campTopic: IGetCampResult[];
searchCamp?: IGetCampResult[];
detailCamp?: IGetCampResult[];
camp: IGetCampResult[];
regionCamp: IGetCampResult[];
nextPage?: number;
lastPage?: boolean;
isLast?: boolean;
pageParam?: number;
fetchNextPage: boolean;
isSuccess: boolean;
hasNextPage: boolean;
refetch: boolean;
icons: string;
}
κ·Έλ°λ°, λ€μλ² λ λλ§ μλ λ error boundary μ κ±Έλ €μ error νμ΄μ§λ‘ λμ΄κ°λ λ¬Έμ λ₯Ό μ§λ©΄νκ² λμμ΅λλ€. μλ¬ λ΄μ©μ ν΄λΉ λ°μ΄ν° νμμ΄ apiμ λ§μ§ μλ€λ λ΄μ©μ΄μκ³ , κ·ΈλμμΈμ§ μ ν¬ νλ‘ νΈμ λ¬Έμ λΌκ³ νλ¨μ΄ λμ΄ consoleλ‘ ν΄λΉ μλ²μμ λμ΄μ€λ λ°μ΄ν°λ₯Ό νμΈνμ, μ΄μ μ λ°±μλμμ λ겨쀬λ λ°μ΄ν° νμκ³Ό λ°°μ΄μ κΉμ΄κ° λ€λ₯΄κ² λ³κ²½λμ΄ λμ΄μ€κ² λ κ²μ΄ μμΈμ΄μμ΅λλ€.
λ¬Όλ‘ ν΄λΉ κ°μ²΄λ°°μ΄μ κ°λ€μ μΈν°νμ΄μ€λ‘ μ§μ λ νμ μ λ£μ΄μ£Όλ κ²μ΄ μλ Any λ₯Ό μ¬μ©νκ² λλ©΄ μΆνμ λ°μ΄ν° νμμ΄ λ³κ²½λμ΄λ 무λνκ² μ€νμ λλ, νμ μ μ νν λͺ μνμ¬ μκΈ°μΉ λͺ»ν μλ¬λ₯Ό λ°©μ§νκΈ° μνμ¬ νμ μ€ν¬λ¦½νΈλ₯Ό λμ νμκΈ°μ ν΄κ²°λμ΄μΌλλ€κ³ μκ°νμμ΅λλ€.