Paragraph-level links, preview tooltips

This commit is contained in:
Adrian Rumpold
2025-04-30 12:04:38 +02:00
parent ea7885eeee
commit 7dd913df7b
25 changed files with 569 additions and 102 deletions

View File

@@ -24,6 +24,21 @@ async function getArticle(
return response.data;
}
async function getParagraph(
celexId: string,
article: number,
paragraph: number,
language: string
): Promise<string> {
console.debug(
`Fetching article ${article} paragraph ${paragraph} for CELEX ID ${celexId} in ${language} language`
);
const response = await axios.get<string>(
`${celexId}/articles/${article}/${paragraph}/${language}`
);
return response.data;
}
async function getArticleIds(celexId: string): Promise<number[]> {
console.debug(`Fetching article list for CELEX ID ${celexId}`);
const response = await axios.get<number[]>(`${celexId}/articles`);
@@ -39,4 +54,4 @@ async function getToc(
return response.data;
}
export { getArticle, getArticleIds, getToc };
export { getArticle, getArticleIds, getParagraph, getToc };