Skip to main content

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

  1. Create an instance of GetPendingPostRequest with the required parameter: postId.
  2. Call the getPendingPost() 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 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

VariableTypeDescriptionOptional
postIdStringUnique identifier of the post

GetPendingPostResponse

List of parameters for the GetPendingPostResponse class

VariableTypeDescriptionOptional
postPostThe fetched pending post entity
usersMap<String, User>Map of users
topicsMap<String, Topic>Map of topics
widgetsMap<String, WidgetModel>Map of widgets
repostedPostsMap<String, Post>Map of reposted posts
userTopicsMap<String, List<String>>Map of user topics