Skip to content
Snippets Groups Projects
Commit b3767ede authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Update API to retrieve articles.

parent 4934b990
No related branches found
No related tags found
No related merge requests found
Pipeline #5653 passed
...@@ -37,11 +37,14 @@ ...@@ -37,11 +37,14 @@
async function retrieveLegalArticle(url: string) { async function retrieveLegalArticle(url: string) {
const response = await fetch( const response = await fetch(
new URL(`recherche?q=${decodeURIComponent(url)}`, $page.data.legalUrl), new URL(
`api/recherche?q=${decodeURIComponent(url)}`,
$page.data.legalUrl,
),
{ headers: { Accept: "application/json" } }, { headers: { Accept: "application/json" } },
) )
const { articles } = await response.json() const { article, id } = await response.json()
return articles?.[0] return article?.[id]
} }
</script> </script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment