From 1fa2c6d32f54072e3bed1b5a24eebb167447d985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=84=86=E1=85=B5=E1=86=AB=E1=84=92?= =?UTF-8?q?=E1=85=B4?= Date: Wed, 24 Apr 2024 18:26:19 +0900 Subject: [PATCH 01/10] =?UTF-8?q?hotfix:=20=EC=9D=B4=EB=A6=84=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mocks/handlers/event/event.mock.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mocks/handlers/event/event.mock.ts b/src/mocks/handlers/event/event.mock.ts index 951ff27e..ab060c99 100644 --- a/src/mocks/handlers/event/event.mock.ts +++ b/src/mocks/handlers/event/event.mock.ts @@ -86,7 +86,7 @@ export const eventListMock: EventList = { info: readEventMock0, mentorInfo: { mentorId: 0, - nickname: '윤지석', + nickname: '손웅정', imageUrl: '', }, }, @@ -94,7 +94,7 @@ export const eventListMock: EventList = { info: readEventMock1, mentorInfo: { mentorId: 0, - nickname: '윤지석', + nickname: '손웅정', imageUrl: '', }, }, @@ -102,7 +102,7 @@ export const eventListMock: EventList = { info: readEventMock2, mentorInfo: { mentorId: 0, - nickname: '윤지석', + nickname: '손웅정', imageUrl: '', }, }, @@ -110,7 +110,7 @@ export const eventListMock: EventList = { info: readEventMock3, mentorInfo: { mentorId: 0, - nickname: '윤지석', + nickname: '손웅정', imageUrl: '', }, }, From 2ec17615a13ec873d9f964de6ea872a58604fcb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=84=86=E1=85=B5=E1=86=AB=E1=84=92?= =?UTF-8?q?=E1=85=B4?= Date: Wed, 24 Apr 2024 18:55:12 +0900 Subject: [PATCH 02/10] =?UTF-8?q?chore:=20=EC=9D=B4=EB=A6=84=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mocks/handlers/user/user.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mocks/handlers/user/user.ts b/src/mocks/handlers/user/user.ts index 6e2e76ce..c68abd24 100644 --- a/src/mocks/handlers/user/user.ts +++ b/src/mocks/handlers/user/user.ts @@ -3,7 +3,7 @@ import { environments } from '~/config/environments'; import { ReadMentor } from '~/types/mentor'; const mentorMock: ReadMentor = { - nickname: '윤지석', + nickname: '손웅정', experiencedPositions: ['BACK', 'FRONT'], careerContent: '', careerYear: 4, From 6dc977f338b54bfdea748ad2680f5ded5d5d5ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=84=86=E1=85=B5=E1=86=AB=E1=84=92?= =?UTF-8?q?=E1=85=B4?= Date: Wed, 24 Apr 2024 21:08:13 +0900 Subject: [PATCH 03/10] =?UTF-8?q?fix:=20router=20=EB=A1=9C=EB=8D=94=20?= =?UTF-8?q?=EC=9B=90=EC=83=81=EB=B3=B5=EA=B5=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/UserLoader.tsx | 45 +++++++++++++++++++++------------------ src/routes/router.tsx | 19 ++++++----------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/src/routes/UserLoader.tsx b/src/routes/UserLoader.tsx index e89812e4..dd577c04 100644 --- a/src/routes/UserLoader.tsx +++ b/src/routes/UserLoader.tsx @@ -1,6 +1,7 @@ -import { useToast } from '@chakra-ui/react'; -import { Navigate, Outlet } from 'react-router-dom'; -import { appPaths } from '~/config/paths'; +// import { useToast } from '@chakra-ui/react'; +// import { Navigate } from 'react-router-dom'; +import { Outlet } from 'react-router-dom'; +// import { appPaths } from '~/config/paths'; import useUser from '~/hooks/useUser'; export type CheckUser = { @@ -10,29 +11,31 @@ export type CheckUser = { const useUserCheck = ({ role }: CheckUser) => { const { user } = useUser(); - const toast = useToast(); + // const toast = useToast(); if (!user) { - toast.closeAll(); - toast({ - description: '로그인이 필요해요.', - status: 'info', - }); - return ( - - ); + // toast.closeAll(); + // toast({ + // description: '로그인이 필요해요.', + // status: 'info', + // }); + // return ( + // + // ); + /*TODO - 유저 mock 작성 후 수정 */ + return ; } if (role && user.role !== role) { - toast.closeAll(); - toast({ - description: `${role === 'mentee' ? '멘티' : '멘토'}로 로그인해야 확인할 수 있어요.`, - status: 'info', - }); - return ; + // toast.closeAll(); + // toast({ + // description: `${role === 'mentee' ? '멘티' : '멘토'}로 로그인해야 확인할 수 있어요.`, + // status: 'info', + // }); + // return ; } return ; diff --git a/src/routes/router.tsx b/src/routes/router.tsx index 418b629b..d757d562 100644 --- a/src/routes/router.tsx +++ b/src/routes/router.tsx @@ -2,12 +2,12 @@ import { createBrowserRouter } from 'react-router-dom'; import ErrorBoundary from './ErrorBoundary'; import { EventCreateLoader } from './EventCreateLoader'; import FeedbackLayout from './FeedbackLayout'; -// import { FeedbackResumeLoader } from './FeedbackResumeLoader'; +import { FeedbackResumeLoader } from './FeedbackResumeLoader'; import FocusLayout from './FocusLayout'; import GuestLoader from './GuestLoader'; import Layout from './Layout'; import MainLayout from './MainLayout'; -// import { MenteeLoader, MentorLoader, UserLoader } from './UserLoader'; +import { MenteeLoader, MentorLoader, UserLoader } from './UserLoader'; import { CreateEventPage } from '~/pages/EventPages/CreateEventPage'; import { EditEventPage } from '~/pages/EventPages/EditEventPage'; import { EventDetailPage } from '~/pages/EventPages/EventDetailPage'; @@ -39,8 +39,7 @@ const router = createBrowserRouter([ element: , children: [ { - // element: , - element: <>, + element: , children: [ { path: 'mypage', element: }, { path: 'user/edit-info', element: }, @@ -51,8 +50,7 @@ const router = createBrowserRouter([ ], }, { - // element: , - element: <>, + element: , children: [ { path: 'resume/management', @@ -63,8 +61,7 @@ const router = createBrowserRouter([ ], }, { - // element: , - element: <>, + element: , children: [ { path: 'write-review', element: }, @@ -100,13 +97,11 @@ const router = createBrowserRouter([ element: , children: [ { - // element: , - element: <>, + element: , children: [{ index: true, element: }], }, { - // element: , - element: <>, + element: , children: [{ path: 'feedback/reflect', element: }], }, ], From 7e14f715da3735ebe7577c82c13dbbf076a3dbe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=84=86=E1=85=B5=E1=86=AB=E1=84=92?= =?UTF-8?q?=E1=85=B4?= Date: Wed, 24 Apr 2024 21:18:59 +0900 Subject: [PATCH 04/10] =?UTF-8?q?feat:=20=EC=9D=B4=EB=A0=A5=EC=84=9C=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EA=B0=80?= =?UTF-8?q?=EC=A0=B8=EC=98=A4=EA=B8=B0=20msw?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mocks/handlers/resume/resume.ts | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/mocks/handlers/resume/resume.ts b/src/mocks/handlers/resume/resume.ts index 72413fd9..bfa07f9e 100644 --- a/src/mocks/handlers/resume/resume.ts +++ b/src/mocks/handlers/resume/resume.ts @@ -3,6 +3,40 @@ import { environments } from '~/config/environments'; export const handlers = [ http.post(`${environments.baseUrlEnv()}/v1/resumes`, () => { + return HttpResponse.json({ id: 0 }); + }), + http.get(`${environments.baseUrlEnv()}/v1/resumes/:id/basic`, () => { + return HttpResponse.json({ + title: '이력서 제목', + position: 'FRONT', + skills: ['React', 'TypeScript'], + introduce: '', + ownerInfo: { + id: 0, + name: '손흥민', + phoneNumber: '01012345678', + }, + }); + }), + http.get(`${environments.baseUrlEnv()}/v1/resumes/:id/links`, () => { + return HttpResponse.json(); + }), + http.get(`${environments.baseUrlEnv()}/v1/resumes/:id/careers`, () => { + return HttpResponse.json(); + }), + http.get(`${environments.baseUrlEnv()}/v1/resumes/:id/projects`, () => { + return HttpResponse.json(); + }), + http.get(`${environments.baseUrlEnv()}/v1/resumes/:id/activities`, () => { + return HttpResponse.json(); + }), + http.get(`${environments.baseUrlEnv()}/v1/resumes/:id/certifications`, () => { + return HttpResponse.json(); + }), + http.get(`${environments.baseUrlEnv()}/v1/resumes/:id/foreignLanguages`, () => { + return HttpResponse.json(); + }), + http.get(`${environments.baseUrlEnv()}/v1/resumes/:id/trainings`, () => { return HttpResponse.json(); }), ]; From 0fae0c4c4d0eecfe835d56e17aff64691e6e0954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=84=86=E1=85=B5=E1=86=AB=E1=84=92?= =?UTF-8?q?=E1=85=B4?= Date: Wed, 24 Apr 2024 21:20:25 +0900 Subject: [PATCH 05/10] =?UTF-8?q?chore:=20position=20=ED=83=80=EC=9E=85=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/types/basicInfo.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/types/basicInfo.ts b/src/types/basicInfo.ts index 43b775cd..cbc0641c 100644 --- a/src/types/basicInfo.ts +++ b/src/types/basicInfo.ts @@ -1,6 +1,8 @@ +import { Position } from './position'; + export type BasicInfo = { title?: string; - position: string; + position: Position; skills: string[]; introduce: string; ownerInfo?: { From ab5f0558edb8aae1f10f6d62ca09479bd5750ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=84=86=E1=85=B5=E1=86=AB=E1=84=92?= =?UTF-8?q?=E1=85=B4?= Date: Wed, 24 Apr 2024 21:48:44 +0900 Subject: [PATCH 06/10] =?UTF-8?q?refactor:=20=EC=9D=B4=EB=A0=A5=EC=84=9C?= =?UTF-8?q?=20=EC=B9=B4=ED=85=8C=EA=B3=A0=EB=A6=AC=20=EB=82=99=EA=B4=80?= =?UTF-8?q?=EC=A0=81=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mocks/handlers/resume/resume.ts | 18 ++++++++++++++++++ src/queries/resume/useOptimsticPostCategory.ts | 5 +++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/mocks/handlers/resume/resume.ts b/src/mocks/handlers/resume/resume.ts index bfa07f9e..2fa33ac5 100644 --- a/src/mocks/handlers/resume/resume.ts +++ b/src/mocks/handlers/resume/resume.ts @@ -39,4 +39,22 @@ export const handlers = [ http.get(`${environments.baseUrlEnv()}/v1/resumes/:id/trainings`, () => { return HttpResponse.json(); }), + http.post(`${environments.baseUrlEnv()}/v1/resumes/:id/careers`, () => { + return HttpResponse.json(); + }), + http.post(`${environments.baseUrlEnv()}/v1/resumes/:id/projects`, () => { + return HttpResponse.json(); + }), + http.post(`${environments.baseUrlEnv()}/v1/resumes/:id/activities`, () => { + return HttpResponse.json(); + }), + http.post(`${environments.baseUrlEnv()}/v1/resumes/:id/certifications`, () => { + return HttpResponse.json(); + }), + http.post(`${environments.baseUrlEnv()}/v1/resumes/:id/foreignLanguages`, () => { + return HttpResponse.json(); + }), + http.post(`${environments.baseUrlEnv()}/v1/resumes/:id/trainings`, () => { + return HttpResponse.json(); + }), ]; diff --git a/src/queries/resume/useOptimsticPostCategory.ts b/src/queries/resume/useOptimsticPostCategory.ts index c1370161..79716132 100644 --- a/src/queries/resume/useOptimsticPostCategory.ts +++ b/src/queries/resume/useOptimsticPostCategory.ts @@ -17,7 +17,7 @@ export const useOptimisticPostCategory = ({ const toast = useToast(); return useMutation({ mutationFn, - onMutate: async (newCategoryBlock) => { + onMutate: async ({ body: newCategoryBlock }) => { await queryClient.cancelQueries({ queryKey: TARGET_QUERY_KEY }); const previousCategoryData = queryClient.getQueryData(TARGET_QUERY_KEY); queryClient.setQueryData(TARGET_QUERY_KEY, (old: T[]) => { @@ -36,7 +36,8 @@ export const useOptimisticPostCategory = ({ queryClient.setQueryData(TARGET_QUERY_KEY, context?.previousCategoryData); }, onSettled: () => { - queryClient.invalidateQueries({ queryKey: TARGET_QUERY_KEY }); + /*NOTE - msw 작동으로 무조건 쿼리 업데이트 시키도록 임시 주석 처리! */ + // queryClient.invalidateQueries({ queryKey: TARGET_QUERY_KEY }); }, onSuccess: () => { toast({ From cef92e1479ef1b7e1adf074c5c0933f4e4de3124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=84=86=E1=85=B5=E1=86=AB=E1=84=92?= =?UTF-8?q?=E1=85=B4?= Date: Fri, 26 Apr 2024 19:43:09 +0900 Subject: [PATCH 07/10] =?UTF-8?q?fix:=20skills=20undefined=20=EB=B0=A9?= =?UTF-8?q?=EC=96=B4=20=EC=BD=94=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/organisms/BasicInfoView/BasicInfoView.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/organisms/BasicInfoView/BasicInfoView.tsx b/src/components/organisms/BasicInfoView/BasicInfoView.tsx index a3101ee7..402e0e71 100644 --- a/src/components/organisms/BasicInfoView/BasicInfoView.tsx +++ b/src/components/organisms/BasicInfoView/BasicInfoView.tsx @@ -36,8 +36,7 @@ const BasicInfoView = ({ position, skills, introduce, onEditClick }: BasicInfoVi }; const renderSkills = () => { - const hasNoEmptyString = skills.every((skill) => skill !== ''); - if (skills.length > 0 && hasNoEmptyString) { + if (skills && skills.every((skill) => skill !== '')) { const skillLabels = skills.map((skill: string, index: number) => { return ( Date: Fri, 26 Apr 2024 19:53:23 +0900 Subject: [PATCH 08/10] =?UTF-8?q?feat:=20=EC=B0=B8=EA=B3=A0=EB=A7=81?= =?UTF-8?q?=ED=81=AC=20get,=20=EA=B8=B0=EB=B3=B8=EC=A0=95=EB=B3=B4=20patch?= =?UTF-8?q?=20=ED=95=B8=EB=93=A4=EB=9F=AC=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mocks/handlers/resume/resume.ts | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/mocks/handlers/resume/resume.ts b/src/mocks/handlers/resume/resume.ts index 2fa33ac5..bed6a46d 100644 --- a/src/mocks/handlers/resume/resume.ts +++ b/src/mocks/handlers/resume/resume.ts @@ -1,26 +1,29 @@ import { HttpResponse, http } from 'msw'; import { environments } from '~/config/environments'; +const referenceLinkMock = [ + { + componentId: 0, + reflectFeedback: false, + createdDate: '2024-05-01T23:59:59.999Z', + linkType: 'GITHUB', + url: 'https://github.com/resumeme/Frontend', + }, +]; export const handlers = [ http.post(`${environments.baseUrlEnv()}/v1/resumes`, () => { return HttpResponse.json({ id: 0 }); }), http.get(`${environments.baseUrlEnv()}/v1/resumes/:id/basic`, () => { - return HttpResponse.json({ - title: '이력서 제목', - position: 'FRONT', - skills: ['React', 'TypeScript'], - introduce: '', - ownerInfo: { - id: 0, - name: '손흥민', - phoneNumber: '01012345678', - }, - }); + return HttpResponse.json(); }), - http.get(`${environments.baseUrlEnv()}/v1/resumes/:id/links`, () => { + // patchResumeBasicInfo + http.patch(`${environments.baseUrlEnv()}/v2/resumes/:id`, () => { return HttpResponse.json(); }), + http.get(`${environments.baseUrlEnv()}/v1/resumes/:id/links`, () => { + return HttpResponse.json(referenceLinkMock); + }), http.get(`${environments.baseUrlEnv()}/v1/resumes/:id/careers`, () => { return HttpResponse.json(); }), From b06c41cc17e370cec2c57366d81b0632474ac551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=84=86=E1=85=B5=E1=86=AB=E1=84=92?= =?UTF-8?q?=E1=85=B4?= Date: Fri, 26 Apr 2024 19:58:42 +0900 Subject: [PATCH 09/10] =?UTF-8?q?feat:=20=EC=B0=B8=EA=B3=A0=EB=A7=81?= =?UTF-8?q?=ED=81=AC=20post,=20delete=20=ED=95=B8=EB=93=A4=EB=9F=AC=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mocks/handlers/resume/resume.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mocks/handlers/resume/resume.ts b/src/mocks/handlers/resume/resume.ts index bed6a46d..a6ada4a8 100644 --- a/src/mocks/handlers/resume/resume.ts +++ b/src/mocks/handlers/resume/resume.ts @@ -10,9 +10,10 @@ const referenceLinkMock = [ url: 'https://github.com/resumeme/Frontend', }, ]; +const MOCK_RESUME_ID = 0; export const handlers = [ http.post(`${environments.baseUrlEnv()}/v1/resumes`, () => { - return HttpResponse.json({ id: 0 }); + return HttpResponse.json({ id: MOCK_RESUME_ID }); }), http.get(`${environments.baseUrlEnv()}/v1/resumes/:id/basic`, () => { return HttpResponse.json(); @@ -21,6 +22,12 @@ export const handlers = [ http.patch(`${environments.baseUrlEnv()}/v2/resumes/:id`, () => { return HttpResponse.json(); }), + http.post(`${environments.baseUrlEnv()}/v1/resumes/:id/links`, () => { + return HttpResponse.json(); + }), + http.delete(`${environments.baseUrlEnv()}/v1/resumes/:id/components/:linkId`, () => { + return HttpResponse.json(); + }), http.get(`${environments.baseUrlEnv()}/v1/resumes/:id/links`, () => { return HttpResponse.json(referenceLinkMock); }), From 36fd1bf0790d26c85b42def81a8f8a1dfbe078bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=84=86=E1=85=B5=E1=86=AB=E1=84=92?= =?UTF-8?q?=E1=85=B4?= Date: Fri, 26 Apr 2024 20:31:44 +0900 Subject: [PATCH 10/10] =?UTF-8?q?fix:=20=EC=9D=B4=EB=A0=A5=EC=84=9C=20?= =?UTF-8?q?=ED=8F=AC=EC=A7=80=EC=85=98=20=ED=83=80=EC=9E=85=20=ED=92=80?= =?UTF-8?q?=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/types/basicInfo.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/types/basicInfo.ts b/src/types/basicInfo.ts index cbc0641c..43b775cd 100644 --- a/src/types/basicInfo.ts +++ b/src/types/basicInfo.ts @@ -1,8 +1,6 @@ -import { Position } from './position'; - export type BasicInfo = { title?: string; - position: Position; + position: string; skills: string[]; introduce: string; ownerInfo?: {