Delete Post
Users have the capability to delete their own posts, allowing them to easily remove any content they no longer wish to share.
note
Community Managers can also delete other members' posts, but a reason is required.
Follow these steps to delete a post
- Create a DeletePostRequest object using
DeletePostRequest.builder()
class by passing all the required parameters. - Call
deletePost()
function using the instance ofLMFeedClient
. - Process the response LMResponse<[NoData]> as per your requirement.
// object of DeletePostRequest
let request = DeletePostRequest.builder()
.postId(ENTER_POST_ID) // id of the post to be deleted
.deleteReason("Reason for post deletion") // reason for deletion required when Community Manager deletes others post
.build()
LMFeedClient.shared.deletePost(request) { response in
// response (LMResponse<NoData>)
if (response.success) {
// your function to process post deleted action
processResponse()
} else {
// your function to process error message
processError(response.errorMessage)
}
}
Models
DeletePostRequest
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
postId | String | Unique id of the post to be deleted. | |
deleteReason | String | Reason for post deletion. | ✔ |
note
deleteReason
is only required when Community Manager deletes other members post.