Skip to main content

Get All Pending Posts

The getAllPendingPosts() function is used to fetch all pending posts. It takes a GetAllPendingPostsRequest as input, which includes pagination parameters and a uuid. The function returns an LMResponse<GetAllPendingPostsResponse> as a Future.

Steps to Get All Pending Posts​

  1. Create an instance of GetAllPendingPostsRequest with the required parameters: page, pageSize, and uuid.
  2. Call the getAllPendingPosts() 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 GetAllPendingPostsRequest
GetAllPendingPostsRequest request = GetAllPendingPostsRequest(
page: 1,
pageSize: 10,
uuid: "unique_identifier"
);

// Get the response from calling the function
final LMResponse<GetAllPendingPostsResponse> getAllPendingPostsResponse = await lmFeedClient.getAllPendingPosts(request);

// Process the response, as per requirement
if (getAllPendingPostsResponse.success) {
// your function to handle successful retrieval of all pending posts
handleGetAllPendingPostsSuccess(getAllPendingPostsResponse.data.posts);
} else {
// your function to handle error message
handleGetAllPendingPostsError(getAllPendingPostsResponse.errorMessage);
}

Models​

GetAllPendingPostsRequest​

List of parameters for the GetAllPendingPostsRequest class

VariableTypeDescriptionOptional
pageintPage number for pagination
pageSizeintNumber of items per page
uuidStringUnique identifier

GetAllPendingPostsResponse​

List of parameters for the GetAllPendingPostsResponse class

VariableTypeDescriptionOptional
postsList<Post>List of fetched pending post entities
totalCountintTotal count of pending posts
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✔
filteredCommentsMap<String, Comment>Map of filtered comments✔