커뮤니티 댓글

- 수정 / 삭제 API 적용
This commit is contained in:
Yu Sung
2023-12-20 21:31:31 +09:00
parent cb3a564a29
commit 302f69b265
7 changed files with 176 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ enum CreatorCommunityApi {
case createCommunityPostComment(comment: String, postId: Int, parentId: Int?)
case getCommunityPostCommentList(postId: Int, page: Int, size: Int)
case getCommentReplyList(commentId: Int, page: Int, size: Int)
case modifyComment(request: ModifyCommunityPostCommentRequest)
}
extension CreatorCommunityApi: TargetType {
@@ -30,7 +31,7 @@ extension CreatorCommunityApi: TargetType {
case .communityPostLike:
return "/creator-community/like"
case .createCommunityPostComment:
case .createCommunityPostComment, .modifyComment:
return "/creator-community/comment"
case .getCommunityPostCommentList(let postId, _, _):
@@ -48,6 +49,9 @@ extension CreatorCommunityApi: TargetType {
case .getCommunityPostList, .getCommunityPostCommentList, .getCommentReplyList:
return .get
case .modifyComment:
return .put
}
}
@@ -88,6 +92,9 @@ extension CreatorCommunityApi: TargetType {
"timezone": TimeZone.current.identifier
] as [String: Any]
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
case .modifyComment(let request):
return .requestJSONEncodable(request)
}
}