Node.js based forum software built for the modern web
Revert "fix(spec): always show thumb in topic response"
Julian Lam90434a4668da
diff --git a/public/openapi/components/schemas/PostObject.yaml b/public/openapi/components/schemas/PostObject.yamlindex 526bc2c75e..5ff918cd7f 100644--- a/public/openapi/components/schemas/PostObject.yaml+++ b/public/openapi/components/schemas/PostObject.yaml@@ -74,9 +74,6 @@ PostObject:description: A category identifierslug:type: string- thumb:- type: string- description: An uploaded topic thumbnaildeleted:type: numberpostcount:diff --git a/public/openapi/components/schemas/TopicObject.yaml b/public/openapi/components/schemas/TopicObject.yamlindex 6f2c45cfcf..10453fe22b 100644--- a/public/openapi/components/schemas/TopicObject.yaml+++ b/public/openapi/components/schemas/TopicObject.yaml@@ -41,9 +41,6 @@ TopicObject:type: numberlocked:type: number- thumb:- type: string- description: An uploaded topic thumbnailpinned:type: numberdescription: Whether or not this particular topic is pinned to the top of the@@ -224,6 +221,8 @@ TopicObject:description: HTML injected into the themeindex:type: number+ thumb:+ type: stringrequired:- tid- uiddiff --git a/public/openapi/read/topic/tid/id.yaml b/public/openapi/read/topic/tid/id.yamlindex fab2532476..cdc638a1f5 100644--- a/public/openapi/read/topic/tid/id.yaml+++ b/public/openapi/read/topic/tid/id.yaml@@ -42,9 +42,6 @@ get:type: numberviewcount:type: number- thumb:- type: string- description: An uploaded topic thumbnaildeleted:type: numberlocked:diff --git a/public/openapi/read/topic/topic_id.yaml b/public/openapi/read/topic/topic_id.yamlindex d293d37ce5..c55c6888cd 100644--- a/public/openapi/read/topic/topic_id.yaml+++ b/public/openapi/read/topic/topic_id.yaml@@ -53,9 +53,6 @@ get:type: numberviewcount:type: number- thumb:- type: string- description: An uploaded topic thumbnailpostercount:type: numberdescription: The number of unique users who made a post in this topicdiff --git a/public/openapi/read/unread.yaml b/public/openapi/read/unread.yamlindex 9af7956705..a5fe83348e 100644--- a/public/openapi/read/unread.yaml+++ b/public/openapi/read/unread.yaml@@ -49,9 +49,6 @@ get:type: numberviewcount:type: number- thumb:- type: string- description: An uploaded topic thumbnailpostercount:type: numberteaserPid:diff --git a/src/topics/data.js b/src/topics/data.jsindex d33ddb29d0..720d2e63ad 100644--- a/src/topics/data.js+++ b/src/topics/data.js@@ -98,7 +98,9 @@ function modifyTopic(topic, fields) {escapeTitle(topic);- topic.thumb = validator.escape(String(topic.thumb)) || '';+ if (topic.hasOwnProperty('thumb')) {+ topic.thumb = validator.escape(String(topic.thumb));+ }if (topic.hasOwnProperty('timestamp')) {topic.timestampISO = utils.toISOString(topic.timestamp);