Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/components/writeRetro/layout/Title.tsx
  • Loading branch information
heejung0413 committed Jul 17, 2024
2 parents 0c1fa1c + 8518efe commit 043efc7
Show file tree
Hide file tree
Showing 36 changed files with 942 additions and 169 deletions.
77 changes: 76 additions & 1 deletion src/api/@types/Groups.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// get
// get all groups
export interface GetRetrospectiveGroupsNodes {
id: number;
title: string;
Expand Down Expand Up @@ -27,3 +27,78 @@ export interface GetRetrospectiveGroupsRequest {
keyword: string;
isBookmarked: boolean;
}

// post
export interface PostRetrospectivesGroupRequest {
title: string;
status: string;
thumbnail: string | null;
description: string;
}

export interface PostRetrospectivesGroupResponse {
code: number;
message: string;
data: Array<PostRetrospectivesGroupNodes>;
}

export interface PostRetrospectivesGroupNodes {
id: number;
title: string;
userId: number;
description: string;
status: string;
thumbnail: string;
}

// delete
export interface DeleteRetrospectiveRequest {
retrospectiveGroupId: number;
}

// put
export interface PutRetrospectiveGroupRequest {
title: string;
status: string;
thumbnail: string | null;
description: string;
}

export interface PutRetrospectiveGroupResponse {
code: number;
title: string;
data: Array<PutRetrospectivesGroupNodes>;
}

export interface PutRetrospectivesGroupNodes {
id: number;
title: string;
userId: number;
userName: string;
status: string;
isBookmarked: boolean;
thumbnail: string;
description: string;
updatedDate: Date | string;
}

// get a group
export interface GetRetrospectiveGroupRequest {
retrospectiveGroupId: number;
}

export interface GetRetrospectiveGroupResponse {
code: number;
message: string;
data: Array<GetRetrospectiveGroupNodes>;
}

export interface GetRetrospectiveGroupNodes {
title: string;
userId: number;
userName: string;
description: string;
thumnail: string | null;
status: string;
id: number;
}
2 changes: 2 additions & 0 deletions src/api/@types/Notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export interface NotificationData {
thumbnail: string;
notificationType: TNotificationType;
dateTime: string;
retrospectiveId: number;
teamId: number;
}

export interface PostNotificationRequest {
Expand Down
23 changes: 23 additions & 0 deletions src/api/@types/Retrospectives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,34 @@ export interface PatchRetrospectiveResponse {
data: boolean;
}

export interface PostTransferLeaderRequest {
newLeaderId: number;
retrospectiveId: number;
}

export interface PostTransferLeaderResponse {
code: number;
message: string;
}

export interface LeaderData {
id: number;
title: string;
teamId: number;
userId: number;
templateId: number;
status: keyof TStatus;
thumbnail: string;
startedDate: string;
description: string;
}

export interface RetrospectivesClient {
onlyGet(request: onlyGetRetrospectiveRequest): Promise<onlyGetRetrospectiveResponse>;
create(request: PostRetrospectivesRequest): Promise<PostRetrospectivesResponse>;
get(request: GetRetrospectiveRequest): Promise<GetRetrospectiveData>;
delete(request: DeleteRetrospectiveRequest): Promise<void>;
put(request: PutTeamRetrospectiveRequest): Promise<RetrospectiveResponse>;
leaderPost(request: PostTransferLeaderRequest): Promise<PostTransferLeaderResponse>;
patch(request: PatchRetrospectiveRequest): Promise<PatchRetrospectiveResponse>;
}
3 changes: 3 additions & 0 deletions src/api/@types/Section.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ export interface ActionItemData {
}

export interface CommentData {
sectionId: number;
commentId: number;
userId: number;
content: string;
username: string;
thumbnail: string;
lastModifiedDate: string;
createdDate: string;
}

export interface AddedImageCommentData extends CommentData {
Expand Down
6 changes: 6 additions & 0 deletions src/api/@types/Users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ export interface UserData {
updatedDate: string;
}

export interface PostAdminRequest {
email: string;
admin: boolean;
}

export interface UserClient {
get(): Promise<GetUserResponse>;
adminPost(reuest: PostAdminRequest): Promise<void>;
}
1 change: 0 additions & 1 deletion src/api/imageApi/postImageToS3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { PostImageToS3Request, PostImageToS3Response } from '@/api/@types/Thumbn
const postImageToS3 = async (requestData: PostImageToS3Request): Promise<PostImageToS3Response> => {
try {
const response = await axiosInstance.post<PostImageToS3Response>('/s3/pre-signed-url', requestData);
console.log('사진 s3 요청 성공', response.data);
return response.data;
} catch (error) {
throw new Error('s3 요청 실패');
Expand Down
11 changes: 11 additions & 0 deletions src/api/retroGroupsApi/deleteGroup.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { DeleteRetrospectiveRequest } from '@/api/@types/Groups';
import axiosInstance from '@/api/axiosConfig';

export const DeleteGroup = async ({ retrospectiveGroupId }: DeleteRetrospectiveRequest): Promise<void> => {
try {
const response = await axiosInstance.delete(`/retrospectiveGroups/${retrospectiveGroupId}`);
return response.data;
} catch (error) {
throw new Error(error as string);
}
};
19 changes: 19 additions & 0 deletions src/api/retroGroupsApi/getGroup.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { GetRetrospectiveGroupRequest, GetRetrospectiveGroupResponse } from '@/api/@types/Groups';
import axiosInstance from '@/api/axiosConfig';

export const GetRetrospectiveGroup = async ({
retrospectiveGroupId,
...request
}: GetRetrospectiveGroupRequest): Promise<GetRetrospectiveGroupResponse> => {
try {
const response = await axiosInstance.get<GetRetrospectiveGroupResponse>(
`/retrospectiveGroups/${retrospectiveGroupId}`,
request,
);
return response.data;
} catch (error) {
throw new Error('단일 그룹 조회 실패');
}
};

export default GetRetrospectiveGroup;
13 changes: 13 additions & 0 deletions src/api/retroGroupsApi/postGroup.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { PostRetrospectivesGroupRequest, PostRetrospectivesGroupResponse } from '@/api/@types/Groups';
import axiosInstance from '@/api/axiosConfig';

const postGroup = async (requestData: PostRetrospectivesGroupRequest): Promise<PostRetrospectivesGroupResponse> => {
try {
const response = await axiosInstance.post<PostRetrospectivesGroupResponse>('/retrospectiveGroups', requestData);
return response.data;
} catch (error) {
throw new Error('그룹 생성 실패');
}
};

export default postGroup;
File renamed without changes.
15 changes: 15 additions & 0 deletions src/api/services/Retrospectives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
onlyGetRetrospectiveResponse,
PostRetrospectivesRequest,
PostRetrospectivesResponse,
PostTransferLeaderRequest,
PostTransferLeaderResponse,
RetrospectivesClient,
} from '../@types/Retrospectives';
import axiosInstance from '../axiosConfig';
Expand Down Expand Up @@ -57,6 +59,19 @@ export const RetrospectiveService: RetrospectivesClient = {
throw new Error(error as string);
}
},
leaderPost: async ({
retrospectiveId,
newLeaderId,
}: PostTransferLeaderRequest): Promise<PostTransferLeaderResponse> => {
try {
const response = await axiosInstance.post(
`${ROUTE}/${retrospectiveId}/transferLeadership?newLeaderId=${newLeaderId}`,
);
return response.data;
} catch (error) {
throw new Error(error as string);
}
},

patch: async (retrospectiveId, ...request) => {
return await axiosInstance.patch(`${ROUTE}/${retrospectiveId}/bookmark`, request);
Expand Down
10 changes: 9 additions & 1 deletion src/api/services/User.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UserClient } from '../@types/Users';
import { PostAdminRequest, UserClient } from '../@types/Users';
import axiosInstance from '../axiosConfig';

const ROUTE = 'users';
Expand All @@ -12,4 +12,12 @@ export const UserServices: UserClient = {
throw new Error(error as string);
}
},
adminPost: async (request: PostAdminRequest) => {
try {
const response = await axiosInstance.post(`/${ROUTE}/me/admin-status`, request);
return response.data;
} catch (error) {
throw new Error(error as string);
}
},
};
Loading

0 comments on commit 043efc7

Please sign in to comment.