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 };