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
- Create an instance of
GetAllPendingPostsRequest
with the required parameters:page
,pageSize
, anduuid
. - Call the
getAllPendingPosts()
function using the instance of theLMFeedClient
class, passing the request as a parameter. - 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
Variable | Type | Description | Optional |
---|---|---|---|
page | int | Page number for pagination | |
pageSize | int | Number of items per page | |
uuid | String | Unique identifier |
GetAllPendingPostsResponse
List of parameters for the GetAllPendingPostsResponse
class
Variable | Type | Description | Optional |
---|---|---|---|
posts | List<Post> | List of fetched pending post entities | |
totalCount | int | Total count of pending posts | |
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 | ✔ |
filteredComments | Map<String, Comment> | Map of filtered comments | ✔ |