FEATURE: automatically delete replies on a topic after N days. (#9209)

This commit is contained in:
Vinoth Kannan
2020-03-19 21:06:31 +05:30
committed by GitHub
parent 0cd502a558
commit aad12822b7
16 changed files with 241 additions and 125 deletions
@@ -4,7 +4,14 @@ import RestModel from "discourse/models/rest";
const TopicTimer = RestModel.extend({});
TopicTimer.reopenClass({
updateStatus(topicId, time, basedOnLastPost, statusType, categoryId) {
updateStatus(
topicId,
time,
basedOnLastPost,
statusType,
categoryId,
duration
) {
let data = {
time,
status_type: statusType
@@ -12,6 +19,7 @@ TopicTimer.reopenClass({
if (basedOnLastPost) data.based_on_last_post = basedOnLastPost;
if (categoryId) data.category_id = categoryId;
if (duration) data.duration = duration;
return ajax({
url: `/t/${topicId}/timer`,