Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FE][Release] 240421 배포 테스트 전 중간 빌드 확인 #204

Merged
merged 8 commits into from
Apr 21, 2024
5 changes: 4 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import RetroRevisePage from './pages/RevisePage';
import RetroTeamPage from './pages/SectionPage';
import MainLayout from '@/components/layout/MainLayout';
import ProfileLayout from '@/components/layout/ProfileLayout';
// import AcceptInvitePage from '@/pages/AccpetInvitePage';
import AuthPage from '@/pages/AuthPage';
import CreateRetroPage from '@/pages/CreateRetroPage';
import HomePage from '@/pages/HomePage';
Expand Down Expand Up @@ -131,7 +132,9 @@ const App = () => {
</PrivateRoute>
}
/>
<Route path="/invitations/:invitationId" Component={AcceptInvite} />
{/* 발급 될 초대 링크 */}
<Route path="/invitations" Component={AcceptInvite} />
{/* <Route path={`/invitations?invitationId=${invitationId}`} element={<AcceptInvitePage />} /> */}
</Routes>
</Router>
</RecoilRoot>
Expand Down
52 changes: 27 additions & 25 deletions src/api/@types/Comment.ts
Original file line number Diff line number Diff line change
@@ -1,48 +1,50 @@
export interface GetCommentRequest {
id: string;
//post
export interface PostCommentRequest {
sectionId: number;
commentContent: string;
}

export interface GetCommentResponse {
export interface PostCommentResponse {
code: number;
message: string;
data: {
id: number;
content: string;
};
data: PostCommentData;
}

//put
export interface PutCommentRequest {
export interface PostCommentData {
id: number;
userId: number;
sectionId: number;
commentContent: string;
}

//delete
export interface DeleteCommentRequest {
id: number;
//put
export interface PutCommentRequest {
commentId: number;
commentContent: string;
}

export interface DeleteCommentResponse {
export interface PutCommentResponse {
code: number;
message: string;
data: object;
data: PutCommentData;
}

//GetAllComment
export interface AllGetCommentResponse {
code: number;
message: string;
data: CommentData[];
export interface PutCommentData {
commentId: number;
content: string;
}

export interface CommentData {
id: number;
comment: string;
//delete
export interface DeleteCommentRequest {
commentId: number;
}

//Post
export interface DeleteCommentResponse {
code: number;
}

export interface CommentClient {
getComment(request: GetCommentRequest): Promise<GetCommentResponse>;
post(request: PostCommentRequest): Promise<PostCommentResponse>;
delete(request: DeleteCommentRequest): Promise<DeleteCommentResponse>;
getAllComment(): Promise<AllGetCommentResponse>;
put(request: PutCommentRequest): Promise<PutCommentResponse>;
}
1 change: 0 additions & 1 deletion src/api/@types/InviteTeam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ export interface InviteTeamData {
export interface PostInviteTeamRequest {
invitationCode: string;
}
export interface PostInviteTeamResponse {}
18 changes: 14 additions & 4 deletions src/api/@types/Retrospectives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface RetrospectiveData {
userId: number;
leaderName: string;
description: string;
status: keyof TStatus;
status: string;
thumbnail: string;
}

Expand All @@ -46,6 +46,7 @@ export interface GetRetrospectiveResponseNodes {
startDate: string;
createdDate: string;
updatedDate: string;
username: string;
}

export interface GetRetrospectiveData {
Expand Down Expand Up @@ -84,12 +85,20 @@ export interface DeleteRetrospectiveRequest {
}

//put
export interface PutRetrospectiveRequest {
export interface PutTeamRetrospectiveRequest {
retrospectiveId: number;
title: string;
teamId?: number;
description: string;
status: keyof TStatus;
status: string;
thumbnail?: string;
}

export interface PutPersonalRetrospectiveRequest {
retrospectiveId: number;
title: string;
description: string;
status: string;
thumbnail?: string;
}

Expand Down Expand Up @@ -127,6 +136,7 @@ export interface RetrospectivesClient {
create(request: PostRetrospectivesRequest): Promise<PostRetrospectivesResponse>;
get(request: GetRetrospectiveRequest): Promise<GetRetrospectiveData>;
delete(request: DeleteRetrospectiveRequest): Promise<void>;
put(request: PutRetrospectiveRequest): Promise<RetrospectiveResponse>;
putTeam(request: PutTeamRetrospectiveRequest): Promise<RetrospectiveResponse>;
putPersonal(request: PutPersonalRetrospectiveRequest): Promise<RetrospectiveResponse>;
patch(request: PatchRetrospectiveRequest): Promise<PatchRetrospectiveResponse>;
}
3 changes: 2 additions & 1 deletion src/api/@types/Survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export interface PostSurveyRequest {
occupation: string;
region: string;
source: string;
purpose: string;
purposes: string[] | undefined;

}

export interface PostSurveyResponse {
Expand Down
14 changes: 14 additions & 0 deletions src/api/@types/TeamController.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// 팀원 조회
export interface GetTeamMembersRequest {
teamId: number;
retrospectiveId: number;
Expand Down Expand Up @@ -35,7 +36,20 @@ export interface TemplateNameData {
sequence: number;
}

// put 담당자
export interface PutActionItemsRequest {
teamId: number;
retrospectiveId: number;
sectionId: number;
}

export interface PutActionItemsResponse {
code: number;
message: string;
data: object;
}
export interface TeamControllerClient {
TeamMemberGet(request: GetTeamMembersRequest): Promise<GetTeamMembersResponse>;
TemplateNameGet(request: GetTemplateNameRequest): Promise<GetTemplateNameResponse>;
ActionItemsMemberPut(request: PutActionItemsRequest): Promise<PutActionItemsResponse>;
}
22 changes: 11 additions & 11 deletions src/api/@types/User.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// get
export interface GetUsersRequest {
// userId: number;
}

export interface GetUsersResponse {
userId: number;
username: string;
email: string;
thumbnail: string | null;
phone: string | null;
createDate: Date;
updateDate: Date;
code: number;
data: {
userId: number;
userName: string;
email: string;
thumbnail: string | null;
phone: string | null;
createDate: Date;
updateDate: Date;
};
message: string | null;
}
4 changes: 2 additions & 2 deletions src/api/inviteTeamApi/postInviteTeam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import axiosInstance from '../axiosConfig';

const postInviteTeam = async (invitationId: string) => {
try {
const response = await axiosInstance.post('/team/accept-invitation', {
invitationCode: invitationId,
const response = await axiosInstance.post('/teams/accept-invitation', {
invitationCode: invitationId, // useParams 로 받아온 코드
});
console.log('팀원 초대 성공', response.data);
return response.data;
Expand Down
31 changes: 23 additions & 8 deletions src/api/services/Comment.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
import { CommentClient } from '../@types/Comment';
import { mswInstance } from '../client';
import { CommentClient, DeleteCommentRequest, PostCommentRequest, PostCommentResponse } from '../@types/Comment';
import axiosInstance from '../axiosConfig';

const ROUTE = '/comments';

export const CommentService: CommentClient = {
getComment: async id => {
return await mswInstance.get(`/api/${ROUTE}/${id}`);
post: async (request: PostCommentRequest): Promise<PostCommentResponse> => {
try {
const response = await axiosInstance.post(`${ROUTE}`, request);
return response.data;
} catch (error) {
throw new Error(error as string);
}
},
delete: async id => {
return await mswInstance.delete(`/api/${ROUTE}/${id}`);
delete: async ({ commentId }: DeleteCommentRequest) => {
try {
const response = await axiosInstance.delete(`${ROUTE}/${commentId}`);
return response.data;
} catch (error) {
throw new Error(error as string);
}
},
getAllComment: async () => {
return await mswInstance.get(`api/${ROUTE}`);
put: async ({ commentId, ...request }) => {
try {
const response = await axiosInstance.put(`${ROUTE}/${commentId}`, request);
return response.data;
} catch (error) {
throw new Error(error as string);
}
},
};
11 changes: 10 additions & 1 deletion src/api/services/Retrospectives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,16 @@ export const RetrospectiveService: RetrospectivesClient = {
}
},

put: async ({ retrospectiveId }, ...request) => {
putTeam: async ({ retrospectiveId, ...request }) => {
try {
const response = await axiosInstance.put(`${ROUTE}/${retrospectiveId}`, request);
return response.data;
} catch (error) {
throw new Error(error as string);
}
},

putPersonal: async ({ retrospectiveId, ...request }) => {
try {
const response = await axiosInstance.put(`${ROUTE}/${retrospectiveId}`, request);
return response.data;
Expand Down
14 changes: 12 additions & 2 deletions src/api/services/TeamController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import {
GetTemplateNameRequest,
GetTemplateNameResponse,
TeamControllerClient,
} from '../@types/TeamController';
import axiosInstance from '../axiosConfig';
PutActionItemsRequest,
PutActionItemsResponse,
} from '@/api/@types/TeamController';
import axiosInstance from '@/api/axiosConfig';

const TEAMS_ROUTE = 'teams';
const TEMPLATE_ROUTE = 'retrospective-templates';
Expand All @@ -26,4 +28,12 @@ export const TeamControllerServices: TeamControllerClient = {
throw new Error(error as string);
}
},
ActionItemsMemberPut: async (request: PutActionItemsRequest): Promise<PutActionItemsResponse> => {
try {
const response = await axiosInstance.put(`/sections/action-itmes`, request);
return response.data;
} catch (error) {
throw new Error(error as string);
}
},
};
2 changes: 1 addition & 1 deletion src/api/survey/postSurvey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import axiosInstance from '../axiosConfig';
// post 요청
export const PostSurvey = async (requestData: PostSurveyRequest): Promise<PostSurveyResponse> => {
try {
const response = await axiosInstance.post<PostSurveyResponse>('/surveys/response', requestData);
const response = await axiosInstance.post<PostSurveyResponse>('/surveys/responses', requestData);
console.log('설문조사 전송 성공', response.data);
return response.data;
} catch (error) {
Expand Down
15 changes: 15 additions & 0 deletions src/api/teamControllerApi/getMember.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { GetTeamMembersRequest, GetTeamMembersResponse } from '@/api/@types/TeamController';
import axiosInstance from '@/api/axiosConfig';

export const getMember = async ({
teamId,
retrospectiveId,
}: GetTeamMembersRequest): Promise<GetTeamMembersResponse> => {
try {
const response = await axiosInstance.get<GetTeamMembersResponse>(`/teams/${teamId}/users?${retrospectiveId}=`);
console.log('팀 멤버 조회 성공', response.data);
return response.data;
} catch (error) {
throw new Error('팀 멤버 조회 실패');
}
};
13 changes: 13 additions & 0 deletions src/api/teamControllerApi/putActionItemsMember.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { PutActionItemsRequest, PutActionItemsResponse } from '@/api/@types/TeamController';
import axiosInstance from '@/api/axiosConfig';

export const putActionItemsMember = async (requestData: PutActionItemsRequest): Promise<PutActionItemsResponse> => {
try {
// console.log(requestData);
const response = await axiosInstance.put<PutActionItemsResponse>('/sections/action-items', requestData);
// console.log('action item 멤버 저장 성공', response);
return response.data;
} catch (error) {
throw new Error('action item 멤버 저장 실패');
}
};
Binary file removed src/assets/BookmarkIcon_N.png
Binary file not shown.
Binary file removed src/assets/BookmarkIcon_Y.png
Binary file not shown.
Binary file removed src/assets/Link.png
Binary file not shown.
Binary file removed src/assets/TeamIcon.png
Binary file not shown.
Binary file removed src/assets/UserProfile2.png
Binary file not shown.
Loading
Loading