Skip to content

Node.js based forum software built for the modern web

feat: add pinExpiry and pinExpiryISO to topic data

Julian Lamad8e7700371b
diff --git a/src/topics/data.js b/src/topics/data.js
index 720d2e63ad..f518a5f5c0 100644
--- a/src/topics/data.js
+++ b/src/topics/data.js
@@ -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;
}