From 7973c5f3550d9bf98a262e37c06d296762c450d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Mon, 7 Feb 2022 16:26:34 +0400 Subject: [PATCH] Add jwennUser and jwennUserEpiEmail to oki-api --- lib/oki-api.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/oki-api.js b/lib/oki-api.js index 8512817..6b7e743 100644 --- a/lib/oki-api.js +++ b/lib/oki-api.js @@ -52,7 +52,13 @@ export async function jwennKomanteEpiTeksId(teksId) { } export async function jwennUser(userId) { - const query = `_where[id]=${userId}&_where[confirmed]=true` + const query = `_where[id]=${userId}&_where[confirmed]=true&_where[blocked]=false` + const response = await axios.get(`${OKI_API}/users?${query}`) + return response.data[0] +} + +export async function jwennUserEpiEmail(email) { + const query = `_where[email]=${email}&_where[confirmed]=false&_where[blocked]=false` const response = await axios.get(`${OKI_API}/users?${query}`) return response.data[0] }