From 6ae1b63128c24187ea650d8c4c339deedfbaf03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Sun, 6 Feb 2022 18:41:57 +0400 Subject: [PATCH] Add jwennUser to oki-api --- lib/oki-api.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/oki-api.js b/lib/oki-api.js index 7bb4a74..8512817 100644 --- a/lib/oki-api.js +++ b/lib/oki-api.js @@ -50,3 +50,9 @@ export async function jwennKomanteEpiTeksId(teksId) { const response = await axios.get(`${OKI_API}/komante?${query}`) return response.data } + +export async function jwennUser(userId) { + const query = `_where[id]=${userId}&_where[confirmed]=true` + const response = await axios.get(`${OKI_API}/users?${query}`) + return response.data[0] +}