Get Pending Post
The getPendingPost() function is used to fetch a pending post. It takes a GetPendingPostRequest as input, which includes the postId. The function returns an LMResponse<GetPendingPostResponse> as a Future.
Steps to Get a Pending Post
- Create an instance of
GetPendingPostRequestwith the required parameter:postId. - Call the
getPendingPost()function using the instance of theLMFeedClientclass, passing the request as a parameter. - Use the response as per your requirement.
// Create an instance of GetPendingPostRequest
GetPendingPostRequest request = GetPendingPostRequest(
postId: "post_id"
);
// Get the response from calling the function
final LMResponse<GetPendingPostResponse> getPendingPostResponse = await lmFeedClient.getPendingPost(request);
// Process the response, as per requirement
if (getPendingPostResponse.success) {
// your function to handle successful retrieval of the pending post
handleGetPendingPostSuccess(getPendingPostResponse.data);
} else {
// your function to handle error message
handleGetPendingPostError(getPendingPostResponse.errorMessage);
}
Models
GetPendingPostRequest
List of parameters for the GetPendingPostRequest class
| Variable | Type | Description | Optional |
|---|---|---|---|
| postId | String | Unique identifier of the post |
GetPendingPostResponse
List of parameters for the GetPendingPostResponse class
| Variable | Type | Description | Optional |
|---|---|---|---|
| post | Post | The fetched pending post entity | ✔ |
| users | Map<String, User> | Map of users | ✔ |
| topics | Map<String, Topic> | Map of topics | ✔ |
| widgets | Map<String, WidgetModel> | Map of widgets | ✔ |
| repostedPosts | Map<String, Post> | Map of reposted posts | ✔ |
| userTopics | Map<String, List<String>> | Map of user topics | ✔ |