Get Reports
To fetch reports related to posts, comments, and other entities, use the getReports
function. This function retrieves reported content for moderation.
Steps to Get Reports
- Use the
getReports()
function provided by thelmFeedClient
object. - Create an instance of
GetReportsRequest
, as shown in the snippet, and pass it to the above method. - Use the response as per your requirement.
import GetReportsRequest from "../requests/getReportsRequest";
try {
const getReportsRequest = GetReportsRequest.builder()
.setPage(pageNumber) // Page number to fetch
.setPageSize(pageSize) // Number of items per page
.setFilterType(filterTypes) // Types of filters to apply
.setIsClosed(isClosed) // Whether to fetch closed reports
.build();
const response = await lmFeedClient.getReports(getReportsRequest);
// Use the response as per your requirement.
} catch (error) {
// Handle the error as per your requirement.
}
Models
GetReportsRequest
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
page | number | Page number for pagination | |
pageSize | number | Number of items per page | ✓ |
filterType | FilterType[] | Types of filters to apply | ✓ |
isClosed | boolean | Whether to fetch closed reports | ✓ |
GetReportsResponse
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
reports | Report[] | List of reports | |
posts | Record<string, Post> | Map of post objects | |
users | Record<string, User> | Map of user objects | |
repostedPosts | Record<string, Post> | Map of reposted posts | |
topics | Record<string, Topic> | Map of topics | |
userTopics | Record<string, Topic> | Map of user topics | |
widgets | Record<string, Widget> | Map of widgets | |
comments | Record<string, Comment> | Map of comments |
FilterType
VARIABLE | VALUE |
---|---|
POST | post |
COMMENT | comment |
REPLY | reply |
PENDING_POST | pending_post |