mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 21:30:30 +01:00
feat: add pinExpiry and pinExpiryISO to topic data
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user