Edit Comment
The LikeMinds iOS Feed SDK empowers members to edit their own comments, allowing them the convenience and flexibility to modify their shared thoughts and responses within the application. This feature enables users to refine their comments, correct any mistakes, or update their opinions as needed, enhancing the overall user experience and ensuring accurate and up-to-date discussions.
note
Community Managers can also edit the comments of other members.
Steps to edit a comment
- Create a EditCommentRequest object using
EditCommentRequest.builder()
class by passing all the required parameters. - Call
editComment()
function using the instance ofLMFeedClient
. - Process the response LMResponse<EditCommentResponse> as per your requirement.
// object of EditCommentRequest
let request = EditCommentRequest.builder()
.postId(ENTER_POST_ID) // post id of the comment to be edited
.commentId(ENTER_COMMENT_ID) // id of the comment to be edited
.text("Updated text") // updated text of the comment
.build()
LMFeedClient.shared.editComment(request) { response in
// response (LMResponse<EditCommentResponse>)
if (response.success) {
// your function to process the response data
processResponse(response.data)
} else {
// your function to process error message
processError(response.errorMessage)
}
}
note
Same function can be used to edit a reply as well. Just pass the id of the reply as comment id.
note
You must send the text
as it is if you don't want to update it, otherwise the text
will be set to empty.
Models
EditCommentRequest
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
postId | String | Post ID of the comment to be edited. | |
commentId | String | ID of the comment to be edited. | |
text | String | Updated text content of the comment. |
EditCommentResponse
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
comment | Comment | Object of the updated comment. | |
users | [String: User] | Dictionary of user unique id to user object. |