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
- Create an instance of
DeletePendingPostRequestwith the required parameters:postId,deleteReason, andisRepost. - Call the
deletePendingPost()function using the instance of theLMFeedClientclass, passing the request as a parameter. - 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
| Variable | Type | Description | Optional |
|---|---|---|---|
| postId | String | Unique identifier of the post | |
| deleteReason | String | Reason for deletion | |
| isRepost | bool | Indicates if it is a repost |