Reply Comment
The addCommentReply() function facilitates the addition of a reply to a specific comment, extending the conversational aspect of the application. By using this function, developers can empower users to engage in threaded discussions, responding directly to comments within a post.
Steps to Add Comment Reply
- Create an instance of
AddCommentReplyRequestwith the required parameters:text,postId, andcommentId. - Call the
addCommentReply()function using the instance of theLMFeedClientclass, passing the request as a parameter. - Leverage the response as per your application's requirements.
// Create an instance of AddCommentReplyRequest
AddCommentReplyRequest request = (AddCommentReplyRequestBuilder()
..commentId("comment_id")
..text("reply_text")
..postId("post_id"))
.build();
// Get the response from calling the function
final AddCommentReplyResponse replyResponse = await lmFeedClient.addCommentReply(replyRequest);
// Process the response, as per requirement
if (replyResponse.success) {
// your function to handle successful addition of comment reply
handleAddCommentReplySuccess(replyResponse.reply);
} else {
// your function to handle error message
handleAddCommentReplyError(replyResponse.errorMessage);
}
Models
AddCommentReplyRequest
List of parameters for the AddCommentReplyRequest class
| Variable | Type | Description |
|---|---|---|
| text | String | Reply text |
| postId | String | Post ID associated with the comment |
| commentId | String | Parent comment ID for the reply |
AddCommentReplyResponse
List of parameters for the AddCommentReplyResponse class
| Variable | Type | Description | Optional |
|---|---|---|---|
| success | bool | API success status | |
| errorMessage | String | Error message in failure | ✔ |
| reply | Comment | Added comment reply entity | ✔ |
| users | Map<String, User> | Map of user UUIDs to User entities | ✔ |
| topics | Map<String, Topic> | Map of topic IDs to Topic entities | |
| widgets | Map<String, WidgetModel> | Map of widget IDs to WidgetModel entities | |
| userTopics | Map<String, List<String>> | Map of user topics (key: user ID) | ✔ |