批量恢复主题

I need help to undelete deleted posts but in bulk!

eg.
https://example.com/u/{user}/deleted-posts

so i can access all posts but we need to undelete it in bulk!

1 个赞

There is no “undelete” bulk action that I know of, so you’ll need to write a script for this and use the Discourse API. Everything you do in Discourse you can do through the API, check this topic to learn how How to reverse engineer the Discourse API

As instructed in the topic, if you check your network tab (in your browser’s dev tools), you’ll see that whenever the “reverse delete” button is clicked, there is a PUT call made to /posts/<post-id>/recover

So, if you have a list of IDs of the posts you want to “undelete” then you could do so by making successive calls to that end point.

4 个赞

您是通过 API 获得的吗?

如果不是,这里有一些在 rails 中实现此功能的提示:Bulk un-deletion - #3 by pfaffman

3 个赞