fix: technical debts left by the Sites, Authors and SEO slices, plus backend support for the new Sites and Authors pagination

This commit is contained in:
Florian Sylvain committed 2026-10-19 00:25:31 +02:00
1 parent 9f4ce426a8
commit daf3594316
86 files changed
+4223 -1485

No files matched your search

+27 -5
View File
@@ -502,7 +502,7 @@ const articlePage = () => ({
total: 30,
page: 1,
size: 25,
counts: { all: 30, online: 28, draft: 2 },
counts: { all: 30, online: 28, draft: 2, suggestions: 3 },
})
const articleIdErrors = [e(400, ID_FORMAT), e(404, 'Article not found')]
@@ -581,7 +581,7 @@ export const API_GROUPS: ApiGroup[] = [
'art-list',
'GET',
'/v1/article/',
'List one page of articles, newest update first, with the total and the tab counts. Anonymous callers get online articles only.',
'List one page of articles, newest update first, with the total and the tab counts (all, online, draft and suggestions). Anonymous callers get online articles only.',
'Public',
articleErrors(e(400, BODY_MISMATCH)),
json(articlePage()),
@@ -861,6 +861,16 @@ export const API_GROUPS: ApiGroup[] = [
}),
{ query: MEDIA_QUERY },
),
endpoint(
'med-get',
'GET',
'/v1/media/{id}',
'Get one image, with the same fields as an item of the list.',
'Verified user',
verified([e(400, ID_FORMAT), e(401, UNAUTHORIZED), e(404, 'Image not found')]),
json(mediaItem()),
{ pathId: 4 },
),
endpoint(
'med-up',
'POST',
@@ -1224,9 +1234,9 @@ export const API_GROUPS: ApiGroup[] = [
'site-list',
'GET',
'/v1/site/',
'List the sites, the default first and then by name, each with its article count.',
'List the sites, the default first and then by name, each with its article count. Without page or size every matching site is returned; the number of matching sites is in the X-Total-Count header.',
'Verified user',
verified([e(401, UNAUTHORIZED)]),
verified([e(400, BODY_MISMATCH), e(401, UNAUTHORIZED)]),
json([
site(),
site({
@@ -1244,6 +1254,18 @@ export const API_GROUPS: ApiGroup[] = [
default_description: '',
}),
]),
{
query: [
PAGE_QUERY,
SIZE_QUERY,
{
name: 'q',
type: 'string',
required: false,
rule: 'Up to 200 characters, matched in the name, the key or the base URL, ignoring case and accents.',
},
],
},
),
],
},
@@ -1257,7 +1279,7 @@ export const API_GROUPS: ApiGroup[] = [
'author-list',
'GET',
'/v1/author/',
'List the authors by name, each with its article count.',
'List the authors by name, each with its article count. The total is also in the X-Total-Count header.',
'Verified user',
verified([e(400, 'The page, size or search is not valid.'), e(401, UNAUTHORIZED)]),
json({