Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sunminnnnn committed Dec 12, 2024
2 parents 3295394 + 0c1351c commit 73ca017
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
19 changes: 6 additions & 13 deletions src/loaders/aboutPageLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,7 @@ const defaultCEOData: ICEOInfoData = {
imageUrl: defaultCEOLogo,
};

const defaultCorpData: ICorpInfoData[] = [
{
partnerInfo: {
id: 1,
isMain: true,
link: 'https://www.netflix.com/browse',
},
logoImg: LocomoLogo,
},
];


export const aboutPageLoader = async () => {
const errors: AxiosError[] = [];
Expand All @@ -34,7 +25,7 @@ export const aboutPageLoader = async () => {
}), // CEO 데이터 실패 시 기본값 반환
getPartnersData().catch((error) => {
errors.push(error);
return { data: defaultCorpData, error };
return { data: [], error };
}), // Partners 데이터 실패 시 기본값 반환
getCompanyData().catch((error) => {
errors.push(error);
Expand All @@ -46,10 +37,12 @@ export const aboutPageLoader = async () => {
}), // 회사 세부 데이터 실패 시 빈 배열 반환
]);



// 강제 새로고침 효과를 위해 데이터 복사
return {
ceoData: JSON.parse(JSON.stringify(ceoData || defaultCEOData)),
partnersData: JSON.parse(JSON.stringify(partnersData || defaultCorpData)),
partnersData: JSON.parse(JSON.stringify(partnersData || [])),
companyIntroData: companyData.introduction || '',
sloganImageUrl: companyData.sloganImageUrl || '',
companyDetailData: companyDetailData || [],
Expand All @@ -61,7 +54,7 @@ export const aboutPageLoader = async () => {
// 모든 데이터 로드 실패 시 기본값 반환
return {
ceoData: defaultCEOData,
partnersData: defaultCorpData,
partnersData: [],
companyIntroData: '',
sloganImageUrl: '',
companyDetailData: [],
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PromotionPage/AboutPage/AboutPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const AboutPage = () => {
</CorpLogoRowContainer>
</CorpLogoContainer>
) : (
<div data-cy='company-no-data'>기업 정보가 없습니다.</div>
<div data-cy='company-no-data'></div>
)}
</Section>
</ScrollContainer>
Expand Down

0 comments on commit 73ca017

Please sign in to comment.