Edit Comment
The editComment()
function 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 edit other members commennts/replies as well.
Steps to Edit Comment
- Create an instance of
EditCommentRequest
with the required parameters:text
,postId
, andcommentId
. - Call the
editComment()
function using the instance of theLMFeedClient
class, passing the request as a parameter. - Use the response as per your requirement.
// Create an instance of EditCommentRequest
EditCommentRequest request = (EditCommentRequestBuilder()
..postId("post_id")
..commentId("comment_id")
..text("edited_text"))
.build();
// Get the response from calling the function
final EditCommentResponse editCommentResponse = await lmFeedClient.editComment(editCommentRequest);
// Process the response, as per requirement
if (editCommentResponse.success) {
// your function to handle successful comment edit
handleEditCommentSuccess(editCommentResponse.reply);
} else {
// your function to handle error message
handleEditCommentError(editCommentResponse.errorMessage);
}
Models
EditCommentRequest
List of parameters for the EditCommentRequest
class
Variable | Type | Description |
---|---|---|
text | String | Updated comment text |
postId | String | Post ID for the comment |
commentId | String | Comment ID to be edited |
EditCommentResponse
List of parameters for the EditCommentResponse
class
Variable | Type | Description | Optional |
---|---|---|---|
success | bool | API success status | |
errorMessage | String | Error message in failure | ✔ |
reply | Comment | Updated comment entity | ✔ |