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

[FIX] 스웨거에서 커뮤니티 게시글 삭제 api의 response body 삭제 #365

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions functions/api/routes/community/communityPostDELETE.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,5 @@ module.exports = asyncWrapper(async (req, res) => {
await communityDB.deleteCommunityPostById(dbConnection, communityPostId);
await communityDB.deleteCommunityCategoryPostByPostId(dbConnection, communityPostId);

res
.status(statusCode.NO_CONTENT)
.send(util.success(statusCode.NO_CONTENT, responseMessage.DELETE_COMMUNITY_POST_SUCCESS));
Comment on lines -37 to -38
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

응답코드가 204이기 때문에 위와 같이 body를 작성해도 응답에 반영되지 않았습니다.
따라서 body를 아예 삭제합니다.

res.status(statusCode.NO_CONTENT).send();
});
7 changes: 0 additions & 7 deletions functions/api/routes/community/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,6 @@ router.delete(
}
* #swagger.responses[204] = {
description: "커뮤니티 게시글 삭제 성공",
content: {
"application/json": {
schema:{
$ref: "#/components/schemas/responseDeleteCommunityPostSchema"
}
}
}
}
* #swagger.responses[400]
* #swagger.responses[403]
Expand Down
7 changes: 0 additions & 7 deletions functions/constants/swagger/schemas/communitySchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ const requestCommunityReportSchema = {
$communityPostId: 1,
};

const responseDeleteCommunityPostSchema = {
$status: 204,
$success: true,
$message: '커뮤니티 게시글 삭제 성공',
};

module.exports = {
responseCommunityCategorySchema,
responseCommunityPostsDetailSchema,
Expand All @@ -122,5 +116,4 @@ module.exports = {
requestCreateCommunityPostSchema,
responseCommunityReportSchema,
requestCommunityReportSchema,
responseDeleteCommunityPostSchema,
};