Skip to main content

Delete Pending Post

The deletePendingPost() function is used to delete a pending post. It takes a DeletePendingPostRequest as input, which includes the postId, deleteReason, and isRepost. The function returns an LMResponse<void> response as a Future.

Steps to Delete a Pending Post

  1. Create an instance of DeletePendingPostRequest with the required parameters: postId, deleteReason, and isRepost.
  2. Call the deletePendingPost() 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 DeletePendingPostRequest
DeletePendingPostRequest request = DeletePendingPostRequest(
postId: "post_id",
deleteReason: "Reason for deletion",
isRepost: false
);

// Get the response from calling the function
final LMResponse<void> deletePendingPostResponse = await lmFeedClient.deletePendingPost(request);

// Process the response, as per requirement
if (deletePendingPostResponse.success) {
// your function to handle successful deletion of the pending post
handleDeletePendingPostSuccess();
} else {
// your function to handle error message
handleDeletePendingPostError(deletePendingPostResponse.errorMessage);
}

Models

DeletePendingPostRequest

List of parameters for the DeletePendingPostRequest class

VariableTypeDescriptionOptional
postIdStringUnique identifier of the post
deleteReasonStringReason for deletion
isRepostboolIndicates if it is a repost