u
This commit is contained in:
@@ -304,7 +304,7 @@ export function register(app, basePath = '') {
|
||||
* get:
|
||||
* tags: [Category]
|
||||
* summary: Articles in category
|
||||
* description: Returns articles in a category the user is authorized for (omits child articles of a parent article). Each article includes `childCount` (the number of its child articles).
|
||||
* description: Returns articles in a category the user is authorized for (omits child articles of a parent article), sorted alphabetically by name. Each article includes `childCount` (the number of its child articles).
|
||||
* security:
|
||||
* - cookieAuth: []
|
||||
* x-markdown: category/articles.md
|
||||
@@ -401,7 +401,8 @@ export function register(app, basePath = '') {
|
||||
...a,
|
||||
childCount: Number(a.childCount ?? 0),
|
||||
isParent: Boolean(a.isParent ?? a.is_parent),
|
||||
}));
|
||||
}))
|
||||
.sort((a, b) => (a.name ?? '').localeCompare(b.name ?? '') || a.id - b.id);
|
||||
res.status(200).json({ articles });
|
||||
} catch (error) {
|
||||
const status = categoryErrorStatus(error);
|
||||
|
||||
Reference in New Issue
Block a user