|
|
|
@ -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;
|
|
|
|
|
}
|
|
|
|
|