Delete Post

Post deletion feature comes in two ways.

  • Soft Delete

    The post is merely marked as deleted. This means that the post is still in the database, but the isDeleted flag is set to true.

  • Hard Delete

    The post's data is removed from the database along with the reactions, comments, subordinate posts and subordinate posts of subordinate posts. This means that all data for that post is lost and cannot be recovered. If you hard delete a child post, the parent post is not deleted.

Deleting posts and comments is only supported via the SDK. UIKit and console support may be considered in the future.

Only the owner of the post or an admin can update and/or delete a post.

PostRepository provides a convenient method for deleting posts. To delete a post, you need to pass the postId and a boolean parameter. Set the boolean parameter to true for hard deletion and false for soft deletion.

If you do not specify the boolean parameter, it defaults to false, which is equivalent to a soft delete.

The deletePost method returns a promise confirming the server's successful response. Use await to get the result. It returns true if the deletion was successful. Otherwise it returns false.

{
    "success": true
}

Last updated