removing repeat password field in the registration form

This commit is contained in:
Sebastian 2022-10-27 15:24:27 -03:00
parent 3d595ddae2
commit 06ac43b892
No known key found for this signature in database
GPG Key ID: BE4FF68352439FC1

View File

@ -586,7 +586,7 @@ async function abortWithdrawalCall(
error: { error: {
title: `Withdrawal abortion failed.`, title: `Withdrawal abortion failed.`,
description: response.error.description, description: response.error.description,
debug: JSON.stringify(res.status), debug: JSON.stringify(response),
}, },
})); }));
return; return;
@ -676,6 +676,7 @@ async function confirmWithdrawalCall(
return; return;
} }
if (!res || !res.ok) { if (!res || !res.ok) {
const response = await res.json();
// assume not ok if res is null // assume not ok if res is null
console.log( console.log(
`Withdrawal confirmation gave response error (${res.status})`, `Withdrawal confirmation gave response error (${res.status})`,
@ -686,7 +687,7 @@ async function confirmWithdrawalCall(
hasError: true, hasError: true,
error: { error: {
title: `Withdrawal confirmation gave response error`, title: `Withdrawal confirmation gave response error`,
debug: JSON.stringify(res.status), debug: JSON.stringify(response),
}, },
})); }));
return; return;
@ -822,7 +823,7 @@ async function createWithdrawalCall(
return; return;
} }
if (!res.ok) { if (!res.ok) {
const response = await res.text(); const response = await res.json();
console.log( console.log(
`Withdrawal creation gave response error: ${response} (${res.status})`, `Withdrawal creation gave response error: ${response} (${res.status})`,
); );
@ -832,7 +833,7 @@ async function createWithdrawalCall(
error: { error: {
title: `Withdrawal creation gave response error`, title: `Withdrawal creation gave response error`,
description: response.error.description, description: response.error.description,
debug: `${response} (${res.status})`, debug: JSON.stringify(response),
}, },
})); }));
return; return;
@ -905,7 +906,10 @@ async function registrationCall(
try { try {
res = await fetch(url.href, { res = await fetch(url.href, {
method: "POST", method: "POST",
body: JSON.stringify(req), body: JSON.stringify({
username: req.username,
password: req.password,
}),
headers, headers,
}); });
} catch (error) { } catch (error) {
@ -924,15 +928,14 @@ async function registrationCall(
return; return;
} }
if (!res.ok) { if (!res.ok) {
const errorRaw = await res.text(); const response = await res.json();
console.log(
`New registration gave response error (${res.status})`,
errorRaw,
);
pageStateSetter((prevState) => ({ pageStateSetter((prevState) => ({
...prevState, ...prevState,
hasError: true, hasError: true,
error: errorRaw, error: {
title: `New registration gave response error`,
debug: JSON.stringify(response),
},
})); }));
} else { } else {
pageStateSetter((prevState) => ({ pageStateSetter((prevState) => ({
@ -2316,7 +2319,10 @@ function PublicHistories(Props: any): VNode {
...prevState, ...prevState,
hasError: true, hasError: true,
showPublicHistories: false, showPublicHistories: false,
error: i18n`List of public accounts was not found.`, error: {
title: i18n`List of public accounts was not found.`,
debug: JSON.stringify(error),
},
})); }));
break; break;
default: default:
@ -2325,7 +2331,10 @@ function PublicHistories(Props: any): VNode {
...prevState, ...prevState,
hasError: true, hasError: true,
showPublicHistories: false, showPublicHistories: false,
error: i18n`List of public accounts could not be retrieved.`, error: {
title: i18n`List of public accounts could not be retrieved.`,
debug: JSON.stringify(error),
},
})); }));
break; break;
} }