Node.js based forum software built for the modern web
fix(spec): always show thumb in topic response
Julian Lam493c568a759a
diff --git a/public/openapi/components/schemas/PostObject.yaml b/public/openapi/components/schemas/PostObject.yamlindex 5ff918cd7f..526bc2c75e 100644--- a/public/openapi/components/schemas/PostObject.yaml+++ b/public/openapi/components/schemas/PostObject.yaml@@ -74,6 +74,9 @@ 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 10453fe22b..6f2c45cfcf 100644--- a/public/openapi/components/schemas/TopicObject.yaml+++ b/public/openapi/components/schemas/TopicObject.yaml@@ -41,6 +41,9 @@ 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@@ -221,8 +224,6 @@ 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 cdc638a1f5..fab2532476 100644--- a/public/openapi/read/topic/tid/id.yaml+++ b/public/openapi/read/topic/tid/id.yaml@@ -42,6 +42,9 @@ 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 c55c6888cd..d293d37ce5 100644--- a/public/openapi/read/topic/topic_id.yaml+++ b/public/openapi/read/topic/topic_id.yaml@@ -53,6 +53,9 @@ 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 a5fe83348e..9af7956705 100644--- a/public/openapi/read/unread.yaml+++ b/public/openapi/read/unread.yaml@@ -49,6 +49,9 @@ 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 720d2e63ad..d33ddb29d0 100644--- a/src/topics/data.js+++ b/src/topics/data.js@@ -98,9 +98,7 @@ function modifyTopic(topic, fields) {escapeTitle(topic);- if (topic.hasOwnProperty('thumb')) {- topic.thumb = validator.escape(String(topic.thumb));- }+ topic.thumb = validator.escape(String(topic.thumb)) || '';if (topic.hasOwnProperty('timestamp')) {topic.timestampISO = utils.toISOString(topic.timestamp);