From 261530b474fbaed39b9823c2531a28e1a89e3f88 Mon Sep 17 00:00:00 2001 From: GabrielTrettel Date: Fri, 22 Oct 2021 11:05:45 -0300 Subject: [PATCH] API register function --- src/app/api/auth.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/api/auth.js b/src/app/api/auth.js index 23fb782..d01dceb 100644 --- a/src/app/api/auth.js +++ b/src/app/api/auth.js @@ -9,7 +9,6 @@ function signup({ number, password, dateofborn, - confirmPassword, institutionName, gender, state, @@ -19,7 +18,7 @@ function signup({ secQuestionAns, consent, }) { - const body = JSON.stringify({ + const body = { username: number, nickname: name, password: password, @@ -33,11 +32,14 @@ function signup({ securityanswer: secQuestionAns, termsofusage: consent, roles: ["ROLE_CLIENT"], - }); + }; - console.log(body); + Object.entries(body).forEach(([key, value]) => { + value == "" && delete body[key] + }); return authClient.post(`/signup`, body); + } export { login, signup };