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, number,
password, password,
dateofborn, dateofborn,
confirmPassword,
institutionName, institutionName,
gender, gender,
state, state,
@ -19,7 +18,7 @@ function signup({
secQuestionAns, secQuestionAns,
consent, consent,
}) { }) {
const body = JSON.stringify({
const body = {
username: number, username: number,
nickname: name, nickname: name,
password: password, password: password,
@ -33,11 +32,14 @@ function signup({
securityanswer: secQuestionAns, securityanswer: secQuestionAns,
termsofusage: consent, termsofusage: consent,
roles: ["ROLE_CLIENT"], roles: ["ROLE_CLIENT"],
});
};
console.log(body);
Object.entries(body).forEach(([key, value]) => {
value == "" && delete body[key]
});
return authClient.post(`/signup`, body); return authClient.post(`/signup`, body);
} }
export { login, signup }; export { login, signup };
Loading…
Cancel
Save