Paragraph-level links, preview tooltips
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user