Like Post
The LikeMinds React Feed SDK incorporates a "like" feature that enables users to express their appreciation for posts by other members. With just a simple tap, users can indicate their interest and support for specific content on their feed.
Steps to like a post
- Use the
likePost()
function provided by thelmFeedClient
object created earlier. - Create an instance of
LikePostRequest
, as shown in the snippet and pass it to the above method. - Use the response as per your requirement
try {
const likePostRequest = LikePostRequest.builder()
.setPostId("<ENTER_POST_ID>")
.build();
const response = await lmFeedClient.likePost(likePostRequest);
// Use the response as per your requirement.
} catch (error) {
// Use the error as per your requirement.
}
Models
LikePostRequest
Variable | Type | Description | Optional |
---|---|---|---|
postId | string | Unique id of the post |
LikePostResponse
Variable | Type | Description | Optional |
---|---|---|---|
success | boolean | True if api succeeds, False otherwise | |
errorMessage | string | Error log incase the api fails | ✔️ |