Pin Post
The pinPost()
function allows users to conveniently "pin" posts, granting them the ability to highlight and prioritize important content on their feed. This feature ensures that selected posts remain prominently displayed at the top of the feed for improved visibility and easy access.
Steps to Pin a Post
- Create an instance of
PinPostRequest
with the required parameter:postId
for the post to be pinned. - Call the
pinPost()
function using the instance of theLMFeedClient
class, passing the request as a parameter. - Use the response as per your requirement.
// Create an instance of PinPostRequest
PinPostRequest request = (PinPostRequestBuilder()
..postId("post_id"))
.build();
// Get the response from calling the function
final PinPostResponse pinPostResponse = await lmFeedClient.pinPost(pinPostRequest);
// Process the response, as per requirement
if (pinPostResponse.success) {
// your function to handle successful post pinning
handlePinPostSuccess();
} else {
// your function to handle error message
handlePinPostError(pinPostResponse.errorMessage);
}
Models
PinPostRequest
List of parameters for the PinPostRequest
class
Variable | Type | Description | Optional |
---|---|---|---|
postId | String | ID of the post to be pinned |
PinPostResponse
List of parameters for the PinPostResponse
class
Variable | Type | Description | Optional |
---|---|---|---|
success | bool | API success status | |
errorMessage | String | Error message in case of failure | ✔ |