This commit is contained in:
seb
2026-10-04 21:22:02 +02:00
parent 45369d11da
commit 3ac713732c
12 changed files with 92 additions and 92 deletions

View File

@@ -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 father 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). Each article includes `childCount` (the number of its child articles).
* security:
* - cookieAuth: []
* x-markdown: category/articles.md
@@ -396,11 +396,11 @@ export function register(app, basePath = '') {
try {
const allArticles = await db.getCategoryArticles(req.user.id, parsed.id);
const articles = allArticles
.filter((a) => a.fatherArticleId == null)
.filter((a) => a.parentArticleId == null)
.map((a) => ({
...a,
childCount: Number(a.childCount ?? 0),
isFather: Boolean(a.isFather ?? a.is_father),
isParent: Boolean(a.isParent ?? a.is_parent),
}));
res.status(200).json({ articles });
} catch (error) {