feat: match hook property to topic property

This commit is contained in:
Barış Soner Uşaklı
2020-05-13 12:18:30 -04:00
parent bfad457275
commit 0e58fa33eb

View File

@@ -93,7 +93,8 @@ module.exports = function (Topics) {
throw new Error('[[error:no-privileges]]');
}
await Topics.setTopicField(tid, 'locked', lock ? 1 : 0);
topicData.isLocked = lock;
topicData.isLocked = lock; // deprecate in v2.0
topicData.locked = lock;
plugins.fireHook('action:topic.lock', { topic: _.clone(topicData), uid: uid });
return topicData;