|
|
@ -18,7 +18,11 @@ module.exports = function (Topics) {
|
|
|
|
|
|
|
|
|
|
|
|
async.parallel([
|
|
|
|
async.parallel([
|
|
|
|
function (next) {
|
|
|
|
function (next) {
|
|
|
|
Topics.setTopicField(tid, 'deleted', 1, next);
|
|
|
|
Topics.setTopicFields(tid, {
|
|
|
|
|
|
|
|
deleted: 1,
|
|
|
|
|
|
|
|
deleterUid: uid,
|
|
|
|
|
|
|
|
deletedTimestampISO: (new Date()).toISOString()
|
|
|
|
|
|
|
|
}, next);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
function (next) {
|
|
|
|
function (next) {
|
|
|
|
db.sortedSetsRemove(['topics:recent', 'topics:posts', 'topics:views'], tid, next);
|
|
|
|
db.sortedSetsRemove(['topics:recent', 'topics:posts', 'topics:views'], tid, next);
|
|
|
@ -47,6 +51,9 @@ module.exports = function (Topics) {
|
|
|
|
function (next) {
|
|
|
|
function (next) {
|
|
|
|
Topics.setTopicField(tid, 'deleted', 0, next);
|
|
|
|
Topics.setTopicField(tid, 'deleted', 0, next);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
function (next) {
|
|
|
|
|
|
|
|
Topics.deleteTopicFields(tid, ['deleterUid', 'deletedTimestampISO'], next);
|
|
|
|
|
|
|
|
},
|
|
|
|
function (next) {
|
|
|
|
function (next) {
|
|
|
|
Topics.updateRecent(tid, topicData.lastposttime, next);
|
|
|
|
Topics.updateRecent(tid, topicData.lastposttime, next);
|
|
|
|
},
|
|
|
|
},
|
|
|
|