feat: add pinExpiry and pinExpiryISO to topic data

v1.18.x
Julian Lam 4 years ago
parent 22715d5413
commit ad8e770037

@ -11,7 +11,7 @@ const plugins = require('../plugins');
const intFields = [
'tid', 'cid', 'uid', 'mainPid', 'postcount',
'viewcount', 'postercount', 'deleted', 'locked', 'pinned',
'timestamp', 'upvotes', 'downvotes', 'lastposttime',
'pinExpiry', 'timestamp', 'upvotes', 'downvotes', 'lastposttime',
'deleterUid',
];
@ -110,6 +110,10 @@ function modifyTopic(topic, fields) {
topic.lastposttimeISO = utils.toISOString(topic.lastposttime);
}
if (topic.hasOwnProperty('pinExpiry')) {
topic.pinExpiryISO = utils.toISOString(topic.pinExpiry);
}
if (topic.hasOwnProperty('upvotes') && topic.hasOwnProperty('downvotes')) {
topic.votes = topic.upvotes - topic.downvotes;
}

Loading…
Cancel
Save