feat: closes #7070

This commit is contained in:
Barış Soner Uşaklı
2018-12-06 12:08:23 -05:00
parent 96c1dc6276
commit 7ca62b8399

View File

@@ -1,6 +1,7 @@
'use strict';
var async = require('async');
const async = require('async');
const plugins = require('../plugins');
module.exports = function (Topics) {
Topics.merge = function (tids, uid, callback) {
@@ -34,7 +35,13 @@ module.exports = function (Topics) {
}, next);
},
], next);
}, callback);
}, function (err) {
if (err) {
return callback(err);
}
plugins.fireHook('action:topic.merge', { uid: uid, tids: tids, mergeIntoTid: mergeIntoTid, otherTids: otherTids });
callback();
});
};
function findOldestTopic(tids) {