From 4ff88ebb618c6700931cf2acf7182cd89a0347bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Sat, 26 Jun 2021 12:16:24 +0200 Subject: [PATCH] Add jwennKomanteEpiTeksId to lib/oki-api.js --- lib/oki-api.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/oki-api.js b/lib/oki-api.js index 4d4f5bd..abdff2a 100644 --- a/lib/oki-api.js +++ b/lib/oki-api.js @@ -44,3 +44,9 @@ export async function jwennSlugs() { const response = await axios.get(`${OKI_API}/slugs`) return response.data } + +export async function jwennKomanteEpiTeksId(teksId) { + const query = `_sort=published_at:DESC&_where[teks]=${teksId}&_where[published_at_null]=false` + const response = await axios.get(`${OKI_API}/komante?${query}`) + return response.data +}