diff --git a/src/components/molecules/NationalCouncilReportText/PartyText.tsx b/src/components/molecules/NationalCouncilReportText/PartyText.tsx index c72c6d4..1c3c060 100644 --- a/src/components/molecules/NationalCouncilReportText/PartyText.tsx +++ b/src/components/molecules/NationalCouncilReportText/PartyText.tsx @@ -90,7 +90,7 @@ export const PartyText = ({ if (variation === 1) return ( - {sgYear}년 지방선거에서는{" "} + {sgYear}년 총선에서는{" "} {currentCandidate.length}개 정당에서 후보자가,{" "} {currentElected.length}개 정당에서 당선자가{" "} 나왔어요. @@ -101,8 +101,8 @@ export const PartyText = ({ 지난 선거에서는 {prevElected.length}개{" "} 정당에서만 당선자가 나왔던 걸 생각하면, 이번엔 진짜 다양한 목소리가{" "} - 들린다는 거죠! 여러분의 광역의회에서 다양성의 바람이 솔솔~ 역대급 - 변화가 느껴지지 않나요? + 들린다는 거죠! 여러분의 국회에서 다양성의 바람이 솔솔~ 역대급 변화가 + 느껴지지 않나요? ) : ( // 소수정당 당성자 수가 줄었다면 아래 텍스트 표시 diff --git a/src/components/organisms/LocalCouncilReport.tsx b/src/components/organisms/LocalCouncilReport.tsx index 7983975..349a755 100644 --- a/src/components/organisms/LocalCouncilReport.tsx +++ b/src/components/organisms/LocalCouncilReport.tsx @@ -194,7 +194,7 @@ const LocalCouncilReport = ({ if (sgType === "candidate") { axios .get( - `localCouncil/template-data/${metroId}/${localId}?year=${sgYear}&year=${sgYear}&factor=party`, + `localCouncil/template-data/${metroId}/${localId}?year=${sgYear}&factor=party`, ) .then(response => { const data = response.data as PartyTextData; @@ -212,7 +212,7 @@ const LocalCouncilReport = ({ }); axios .get( - `localCouncil/template-data/${metroId}/${localId}?year=${sgYear}&year=${sgYear}&factor=gender`, + `localCouncil/template-data/${metroId}/${localId}?year=${sgYear}&factor=gender`, ) .then(response => { const data = response.data as GenderTextData; @@ -232,7 +232,9 @@ const LocalCouncilReport = ({ }); } else { axios - .get(`localCouncil/chart-data/${metroId}/${localId}?factor=party`) + .get( + `localCouncil/chart-data/${metroId}/${localId}?factor=party&year=${sgYear}`, + ) .then(response => { const data = response.data.data as PartyPieChartDataAPIResponse; const newPartyPieChartData: PieChartData[] = []; @@ -248,7 +250,9 @@ const LocalCouncilReport = ({ throw new Error("네트워크 문제가 발생했습니다. 다시 시도해주세요."); }); axios - .get(`localCouncil/chart-data/${metroId}/${localId}?factor=gender`) + .get( + `localCouncil/chart-data/${metroId}/${localId}?factor=gender&year=${sgYear}`, + ) .then(response => { const data = response.data.data as GenderPieChartDataAPIResponse; const newGenderPieChartData: PieChartData[] = []; diff --git a/src/components/organisms/MetroCouncilReport.tsx b/src/components/organisms/MetroCouncilReport.tsx index 4f8d04c..8ae9d1e 100644 --- a/src/components/organisms/MetroCouncilReport.tsx +++ b/src/components/organisms/MetroCouncilReport.tsx @@ -85,9 +85,7 @@ const MetroCouncilReport = ({ metroName, metroMap, onLoaded }: Props) => { // 백엔드로부터 텍스트 데이터를 가져옵니다. const fetchTextData = () => { axios - .get( - `metroCouncil/template-data/${metroId}?year=${sgYear}&year=${sgYear}&factor=age`, - ) + .get(`metroCouncil/template-data/${metroId}?year=${sgYear}&factor=age`) .then(response => { setAgeTextData(response.data as AgeTextData); }) @@ -95,9 +93,7 @@ const MetroCouncilReport = ({ metroName, metroMap, onLoaded }: Props) => { throw new Error("네트워크 문제가 발생했습니다. 다시 시도해주세요."); }); axios - .get( - `metroCouncil/template-data/${metroId}?year=${sgYear}&year=${sgYear}&factor=gender`, - ) + .get(`metroCouncil/template-data/${metroId}?year=${sgYear}&factor=gender`) .then(response => { setGenderTextData(response.data as GenderTextData); }) @@ -105,9 +101,7 @@ const MetroCouncilReport = ({ metroName, metroMap, onLoaded }: Props) => { throw new Error("네트워크 문제가 발생했습니다. 다시 시도해주세요."); }); axios - .get( - `metroCouncil/template-data/${metroId}?year=${sgYear}&year=${sgYear}&factor=party`, - ) + .get(`metroCouncil/template-data/${metroId}?year=${sgYear}&factor=party`) .then(response => { setPartyTextData(response.data as PartyTextData); }) @@ -185,7 +179,7 @@ const MetroCouncilReport = ({ metroName, metroMap, onLoaded }: Props) => { if (sgType === "candidate") { axios .get( - `metroCouncil/template-data/${metroId}?year=${sgYear}&year=${sgYear}&factor=party`, + `metroCouncil/template-data/${metroId}?year=${sgYear}&factor=party`, ) .then(response => { const data = response.data as PartyTextData; @@ -203,7 +197,7 @@ const MetroCouncilReport = ({ metroName, metroMap, onLoaded }: Props) => { }); axios .get( - `metroCouncil/template-data/${metroId}?year=${sgYear}&year=${sgYear}&factor=gender`, + `metroCouncil/template-data/${metroId}?year=${sgYear}&factor=gender`, ) .then(response => { const data = response.data as GenderTextData; @@ -223,7 +217,7 @@ const MetroCouncilReport = ({ metroName, metroMap, onLoaded }: Props) => { }); } else { axios - .get(`metroCouncil/chart-data/${metroId}?factor=party`) + .get(`metroCouncil/chart-data/${metroId}?factor=party&year=${sgYear}`) .then(response => { const data = response.data.data as PartyPieChartDataAPIResponse; const newPartyPieChartData: PieChartData[] = []; @@ -239,7 +233,7 @@ const MetroCouncilReport = ({ metroName, metroMap, onLoaded }: Props) => { throw new Error("네트워크 문제가 발생했습니다. 다시 시도해주세요."); }); axios - .get(`metroCouncil/chart-data/${metroId}?factor=gender`) + .get(`metroCouncil/chart-data/${metroId}?factor=gender&year=${sgYear}`) .then(response => { const data = response.data.data as GenderPieChartDataAPIResponse; const newGenderPieChartData: PieChartData[] = []; diff --git a/src/components/organisms/NationalCouncilReport.tsx b/src/components/organisms/NationalCouncilReport.tsx index 4af5d31..61c2b2c 100644 --- a/src/components/organisms/NationalCouncilReport.tsx +++ b/src/components/organisms/NationalCouncilReport.tsx @@ -91,7 +91,7 @@ const NationalCouncilReport = ({ // 백엔드로부터 텍스트 데이터를 가져옵니다. const fetchTextData = () => { axios - .get(`nationalCouncil/template-data?factor=age`) + .get(`nationalCouncil/template-data?factor=age&year=${sgYear}`) .then(response => { setAgeTextData(response.data as AgeTextData); }) @@ -99,7 +99,7 @@ const NationalCouncilReport = ({ throw new Error("네트워크 문제가 발생했습니다. 다시 시도해주세요."); }); axios - .get(`nationalCouncil/template-data?factor=gender`) + .get(`nationalCouncil/template-data?factor=gender&year=${sgYear}`) .then(response => { setGenderTextData(response.data as GenderTextData); }) @@ -107,7 +107,7 @@ const NationalCouncilReport = ({ throw new Error("네트워크 문제가 발생했습니다. 다시 시도해주세요."); }); axios - .get(`nationalCouncil/template-data?factor=party`) + .get(`nationalCouncil/template-data?factor=party&year=${sgYear}`) .then(response => { setPartyTextData(response.data as PartyTextData); })