Skip to content

Commit

Permalink
Merge pull request #36 from Jigeum-lab/develop
Browse files Browse the repository at this point in the history
build: 전체적인 오류 수정
  • Loading branch information
yrrr-rrr authored Sep 25, 2024
2 parents 59ce257 + 7dba91a commit a30f9e0
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/components/main/AllProjectView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ async function getProjects(
) {
setIsLoading(true);
try {
let response = await fetch(`https://name.store:8443/api/project?page=${page}&sort=${sortOption}`);
let response = await fetch(`https://namju.store:8443/api/v1/projects?page=${page}&sort=${sortOption}`);
if (currentCategory !== 'ALLPROJECT') {
response = await fetch(
`https://name.store:8443/api/project?page=${page}&size=10&sort=${sortOption}&category=${currentCategory}`,
`https://namju.store:8443/api/v1/projectss?page=${page}&size=10&sort=${sortOption}&category=${currentCategory}`,
);
}
// const response = await fetch('dummy/projectCollection.json');
Expand Down
2 changes: 1 addition & 1 deletion src/components/projectDetail/AllProjectSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default function AllProjectSlider() {

async function getProjects(updateData: Updater<ProjectGalleryData>) {
try {
const response = await fetch('https://name.store:8443/api/project?page=0&size=1000&sort=createdAt');
const response = await fetch('https://namju.store:8443/api/v1/projects?page=0&size=100&sort=createdAt');
const data = await response.json();
updateData((slideObj) => {
Object.assign(slideObj, data);
Expand Down
2 changes: 1 addition & 1 deletion src/components/projectDetail/FloatingBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default function FloatingBox({ setShowModal }: { setShowModal: React.Disp
<div>
{memberInfo.users.map((memberObj, index) => {
if (index < 5) {
return <s.Img src={`${memberObj.userPicture}`} alt="" key={index} />;
return <s.Img src={memberObj.userPicture} alt="" key={index} />;
}
})}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/projectDetail/Performance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function Performance() {
<s.AwardBox>
{accomplishmentInfo.accomplishments.map((awardObj, index) => (
<s.Award key={index}>
<img src={awardObj.thumbnail} alt="" />
<s.AwardImg src={awardObj.thumbnail} alt="" />
<s.AwardName>{awardObj.title}</s.AwardName>
<s.Agency>{awardObj.publisher}</s.Agency>
</s.Award>
Expand Down
7 changes: 4 additions & 3 deletions src/components/projectDetail/ProjectIntro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default function ProjectIntro() {

async function getData(updateData: Updater<ProjectInfo>, id: string) {
try {
const response = await fetch(`hhttps://name.store:8443/api/project/${id}`);
const response = await fetch(`https://namju.store:8443/api/v1/projects/${id}`);
// const response = await fetch('/public/dummy/atti2.json');
const data = await response.json();
updateData((obj) => {
Expand All @@ -114,9 +114,10 @@ async function getData(updateData: Updater<ProjectInfo>, id: string) {

async function getMember(updateData: Updater<Member>, id: string) {
try {
const response = await fetch(`hhttps://name.store:8443/api/project/${id}/members`);
const response = await fetch(`https://namju.store:8443/api/v1/projects/${id}/members`);
// const response = await fetch('/dummy/attiMember.json');
const data = await response.json();
console.log(data.data);
updateData((obj) => {
Object.assign(obj, data.data);
});
Expand All @@ -127,7 +128,7 @@ async function getMember(updateData: Updater<Member>, id: string) {

async function getAccomplishment(updateAccomplishmentInfo: Updater<Accomplishment>, id: string) {
try {
const response = await fetch(`hhttps://name.store:8443/api/project/${id}/accomplishments`);
const response = await fetch(`https://namju.store:8443/api/v1/projects/${id}/accomplishments`);
// const response = await fetch('dummy/attiPerformance.json');
const data = await response.json();
updateAccomplishmentInfo((draft) => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/projectDetail/Release.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function Release() {

return (
<s.Section>
{releaseInfo.data.map((releaseObj, index) => (
{releaseInfo.projectReleases.map((releaseObj, index) => (
<s.ReleaseBox key={index}>
<s.Title>{releaseObj.title}</s.Title>
<s.ReleaseInformation>{releaseObj.description}</s.ReleaseInformation>
Expand All @@ -27,11 +27,11 @@ export default function Release() {

async function getRelease(updateReleaseInfo: Updater<ReleaseType>, id: string) {
try {
const response = await fetch(`https://name.store:8443/api/project/${id}/release`);
const response = await fetch(`https://namju.store:8443/api/v1/projects/${id}/release`);
// const response = await fetch('dummy/attiRelease.json');
const data = await response.json();
updateReleaseInfo((draft) => {
Object.assign(draft, data);
Object.assign(draft, data.data);
});
} catch (e) {
console.log(e);
Expand Down
4 changes: 2 additions & 2 deletions src/context/ProjectDetailContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ const initialProjectInfo: ProjectInfo = {
};

const initialReleaseInfo: ReleaseType = {
data: [
projectReleases: [
{
id: '',
id: 0,
title: '',
description: '',
createdAt: '',
Expand Down
9 changes: 8 additions & 1 deletion src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ export interface ReleaseObj {
}

export interface ReleaseType {
data: ReleaseObj[];
projectReleases: [
{
id: number;
title: string;
description: string;
createdAt: string;
},
];
}

export interface AccomplishmentObj {
Expand Down
1 change: 0 additions & 1 deletion src/style/projectDetail/IntroductionStyle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const Section = styled.section`
export const Profile = styled.div`
padding: 16px 0;
margin-bottom: 8px;
width: 188px;
height: 148px;
display: flex;
flex-direction: column;
Expand Down
7 changes: 7 additions & 0 deletions src/style/projectDetail/PerformanceStyle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ export const Award = styled.section`
align-items: center;
`;

export const AwardImg = styled.img`
margin-bottom: 16px;
width: 80px;
height: 80px;
border-radius: 100%;
`;

export const AwardName = styled.p`
margin-bottom: 4px;
color: #171719;
Expand Down

0 comments on commit a30f9e0

Please sign in to comment.