Skip to content

Node.js based forum software built for the modern web

fix: spec

Barış Soner Uşaklıfbd85680fb13
diff --git a/public/openapi/api/post-queue.yaml b/public/openapi/api/post-queue.yaml
index 7825ef3e6f..46fa13c328 100644
--- a/public/openapi/api/post-queue.yaml
+++ b/public/openapi/api/post-queue.yaml
@@ -47,28 +47,36 @@ get:
items:
type: object
properties:
- bgColor:
- type: string
cid:
type: number
- color:
- type: string
- disabledClass:
- nullable: true
- icon:
- type: string
- imageClass:
+ description: A category identifier
+ name:
type: string
level:
type: string
- link:
- type: string
- name:
+ icon:
type: string
parentCid:
type: number
- slug:
+ description: The category identifier for the category that is the immediate
+ ancestor of the current category
+ color:
+ type: string
+ bgColor:
+ type: string
+ selected:
+ type: boolean
+ imageClass:
type: string
+ required:
+ - bgColor
+ - cid
+ - color
+ - icon
+ - imageClass
+ - level
+ - name
+ - parentCid
allCategoriesUrl:
type: string
selectedCategory:
diff --git a/public/openapi/api/unread.yaml b/public/openapi/api/unread.yaml
index f383633cfe..f4eb7913bc 100644
--- a/public/openapi/api/unread.yaml
+++ b/public/openapi/api/unread.yaml
@@ -253,6 +253,16 @@ get:
type: string
allCategoriesUrl:
type: string
+ selectedCategory:
+ type: object
+ properties:
+ icon:
+ type: string
+ name:
+ type: string
+ bgColor:
+ type: string
+ nullable: true
selectedCids:
type: array
items:
diff --git a/src/controllers/helpers.js b/src/controllers/helpers.js
index 3fbcc67771..3d4b117ca5 100644
--- a/src/controllers/helpers.js
+++ b/src/controllers/helpers.js
@@ -281,7 +281,7 @@ async function getCategoryData(cids, uid, selectedCid, states, privilege) {
} else if (selectedCategory.length === 1) {
selectedCategory = selectedCategory[0];
} else {
- selectedCategory = undefined;
+ selectedCategory = null;
}
return {
diff --git a/src/controllers/recent.js b/src/controllers/recent.js
index d4e20d69fc..c40795b267 100644
--- a/src/controllers/recent.js
+++ b/src/controllers/recent.js
@@ -65,7 +65,7 @@ recentController.getData = async function (req, url, sort) {
data.showTopicTools = isPrivileged;
data.categories = categoryData.categories;
data.allCategoriesUrl = url + helpers.buildQueryString(req.query, 'cid', '');
- data.selectedCategory = categoryData.selectedCategory || null;
+ data.selectedCategory = categoryData.selectedCategory;
data.selectedCids = categoryData.selectedCids;
data['feeds:disableRSS'] = meta.config['feeds:disableRSS'] || 0;
data.rssFeedUrl = nconf.get('relative_path') + '/' + url + '.rss';