Browse Source

API register function

master
GabrielTrettel 3 years ago
parent
commit
261530b474
  1. 10
      src/app/api/auth.js

10
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 };
Loading…
Cancel
Save