Skip to content

Commit

Permalink
๐Ÿ”€ Fix Portfolio API
Browse files Browse the repository at this point in the history
#270 ํฌํŠธํด๋ฆฌ์˜ค ์ด์Šˆ ํ•ด๊ฒฐ
  • Loading branch information
chaeyoungwon authored Sep 30, 2024
2 parents 5025e22 + 35fdc71 commit c37b949
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 27 deletions.
28 changes: 11 additions & 17 deletions gongjakso/src/pages/Portfolio/MakePortfolio.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const MakePortfolio = ({ portfolioId }) => {
{
id: uuidv4(),
schoolName: '',
gradeStatus: '1ํ•™๋…„',
state: '์žฌํ•™ ์ค‘',
gradeStatus: '',
state: '',
},
]);
const [careerSections, setCareerSections] = useState([
Expand All @@ -38,7 +38,7 @@ const MakePortfolio = ({ portfolioId }) => {
},
]);
const [activitySections, setActivitySections] = useState([
{ id: uuidv4(), activityName: '', activityStatus: 'ํ™œ๋™ ์ค‘' },
{ id: uuidv4(), activityName: '', activityStatus: '' },
]);
const [awardSections, setAwardSections] = useState([
{ id: uuidv4(), competitionName: '', award: '' },
Expand Down Expand Up @@ -138,16 +138,16 @@ const MakePortfolio = ({ portfolioId }) => {
portfolioData.educationList.length
? portfolioData.educationList.map(section => ({
schoolName: section.school || '',
gradeStatus: section.grade || '1ํ•™๋…„',
state: section.state || '์žฌํ•™ ์ค‘',
gradeStatus: section.grade || '',
state: section.state || '',
id: uuidv4(),
}))
: [
{
id: uuidv4(),
schoolName: '',
gradeStatus: '1ํ•™๋…„',
state: '์žฌํ•™ ์ค‘',
gradeStatus: '',
state: '',
},
],
);
Expand Down Expand Up @@ -187,7 +187,7 @@ const MakePortfolio = ({ portfolioId }) => {
{
id: uuidv4(),
activityName: '',
activityStatus: 'ํ™œ๋™ ์ค‘',
activityStatus: '',
},
],
);
Expand Down Expand Up @@ -369,10 +369,7 @@ const MakePortfolio = ({ portfolioId }) => {
<SelectInput
id={`Gradestatus-${index}`}
selectOptions={gradeStatus_options}
placeholder={
section.gradeStatus ||
gradeStatus_options[0]
}
placeholder={section.gradeStatus || 'ํ•™๋…„'}
value={section.gradeStatus || ''}
onChange={value => {
const updatedSections = [
Expand All @@ -389,9 +386,7 @@ const MakePortfolio = ({ portfolioId }) => {
<SelectInput
id={`Educationstatus-${index}`}
selectOptions={status_options}
placeholder={
section.state || status_options[0]
}
placeholder={section.state || '์ƒํƒœ'}
value={section.state || ''}
onChange={value => {
const updatedSections = [
Expand Down Expand Up @@ -569,8 +564,7 @@ const MakePortfolio = ({ portfolioId }) => {
id={`Activitystatus-${index}`}
selectOptions={activityStatus_options}
placeholder={
section.activityStatus ||
activityStatus_options[0]
section.activityStatus || 'ํ™œ๋™ ์ƒํƒœ'
}
value={section.activityStatus || ''}
onChange={value => {
Expand Down
17 changes: 10 additions & 7 deletions gongjakso/src/pages/Portfolio/UsePortfolio.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ const UsePortfolio = () => {

const fileData = fileResponse?.data?.data;
const notionData = notionResponse?.data?.data;

// ํŒŒ์ผ๊ณผ ๋…ธ์…˜ ๋ฐ์ดํ„ฐ ์ƒํƒœ์— ์ €์žฅ
if (fileData) {
if (fileData && fileData.fileUri) {
const fileName = fileData.fileUri
.split('/')
.pop()
Expand All @@ -41,9 +40,10 @@ const UsePortfolio = () => {
uri: fileData.fileUri,
});
}

if (notionData) {
if (notionData && notionData.notionUri) {
setSnsLink(notionData.notionUri || '');
} else {
console.log('No Notion URI found');
}
} catch (error) {
console.error(
Expand All @@ -52,8 +52,9 @@ const UsePortfolio = () => {
);
}
};

fetchPortfolio();
if (id) {
fetchPortfolio();
}
getMyInfo().then(response => {
setProfileData(response?.data);
});
Expand Down Expand Up @@ -192,7 +193,9 @@ const UsePortfolio = () => {
<S.LinkContainer>
<S.LinkIcon />
<S.SNSInput
placeholder="๋…ธ์…˜ ๋งํฌ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”."
placeholder={
!snsLink ? '๋…ธ์…˜ ๋งํฌ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.' : ''
}
value={snsLink} // ๋””ํดํŠธ ๊ฐ’์œผ๋กœ ์ƒํƒœ์—์„œ ๊ฐ€์ ธ์˜จ snsLink ์‚ฌ์šฉ
onChange={e => setSnsLink(e.target.value)}
/>
Expand Down
6 changes: 3 additions & 3 deletions gongjakso/src/pages/ProfilePage/ProfilePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ const ProfilePage = () => {
)}
</S.BoxDetail>
<S.BoxDetail>
<S.SubTitle>๋‚ด๊ฐ€ ๋ชจ์ง‘ ์ค‘์ธ ํŒ€</S.SubTitle>
<S.SubTitle>๋‚˜์˜ ๋ชจ์ง‘ ๊ธฐ๋ก</S.SubTitle>
{postContent1?.map(post => (
<TeamBox
key={post?.id}
Expand All @@ -562,7 +562,7 @@ const ProfilePage = () => {
</S.BoxDetail>
<S.BoxDetail>
<S.SubTitle>
<span>๋‚ด๊ฐ€ ์ง€์›ํ•œ ํŒ€</span>
<span>๋‚˜์˜ ์ง€์› ๊ธฐ๋ก</span>
<Link to="/appliedTeam">
<S.ArrowImage />
</Link>
Expand All @@ -580,7 +580,7 @@ const ProfilePage = () => {
</S.BoxDetail>
<S.BoxDetail>
<S.SubTitle>
<span>๋‚ด๊ฐ€ ์ฐธ์—ฌํ•œ ๊ณต๋ชจ์ „</span>
<span>๋‚˜์˜ ์ฐธ์—ฌ ๊ธฐ๋ก</span>
<Link to="/participatedTeam">
<S.ArrowImage />
</Link>
Expand Down

0 comments on commit c37b949

Please sign in to comment.