Skip to main content

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

  1. Create an instance of EditCommentRequest with the required parameters: text, postId, and commentId.
  2. Call the editComment() function using the instance of the LMFeedClient class, passing the request as a parameter.
  3. 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

VariableTypeDescription
textStringUpdated comment text
postIdStringPost ID for the comment
commentIdStringComment ID to be edited

EditCommentResponse

List of parameters for the EditCommentResponse class

VariableTypeDescriptionOptional
successboolAPI success status
errorMessageStringError message in failure
replyCommentUpdated comment entity