devvit icon indicating copy to clipboard operation
devvit copied to clipboard

Added the ability to nuke all comments of a post

Open ni5arga opened this issue 1 year ago • 2 comments

Added the ability to remove & lock all comments of a post by introducing the handleNukePost function.

handleNukePost allows a moderator to lock or remove all comments in a post. It fetches a post using the provided post ID, checks if the current user has the necessary mod permissions, and then proceeds to lock or remove all comments in the post based on the provided properties. If the skipDistinguished property is true, distinguished comments are skipped. The function logs any failed attempts to lock or remove comments and returns a success message along with the number of comments handled.

Also added a separate form - nukePostForm in main.ts for this purpose.

ni5arga avatar Mar 03 '24 21:03 ni5arga

Thanks for adding this! We're setting up some plumbing to be able to accept this PR and publish it into the official app automatically. We'll give an update / merge it in as soon as that's fixed.

cedaraspen avatar Mar 11 '24 15:03 cedaraspen

That's cool, thanks for letting me know!

ni5arga avatar Mar 11 '24 17:03 ni5arga