Skip to main content

Update Pending Post Status

To update the status of pending posts, use the updatePendingPostStatus function. This function allows moderators to change the status of reported posts.

Steps to Update Pending Post Status

  1. Use the updatePendingPostStatus() function provided by the lmFeedClient object.
  2. Create an instance of UpdatePendingPostStatusRequest, as shown in the snippet, and pass it to the above method.
  3. Use the response as per your requirement.
import UpdatePendingPostStatusRequest from "../requests/updatePendingPostStatusRequest";

try {
const updatePendingPostStatusRequest =
UpdatePendingPostStatusRequest.builder()
.setReportIds(reportIds) // Array of report IDs
.setStatus(status) // New status to update
.build();
const response = await lmFeedClient.updatePendingPostStatus(
updatePendingPostStatusRequest
);
// Use the response as per your requirement.
} catch (error) {
// Handle the error as per your requirement.
}

Models

UpdatePendingPostStatusRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
reportIdsnumber[]Array of report IDs
statusLMFeedReportStatusNew status to update

LMFeedReportStatus

VARIABLEVALUE
APPROVEDapproved
REJECTEDrejected