mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-24 12:35:31 +00:00
feat: register data cleanup
This commit is contained in:
parent
d224159372
commit
0a4b47504a
1 changed files with 5 additions and 0 deletions
|
|
@ -118,6 +118,8 @@
|
|||
console.log(values.parents);
|
||||
console.log(values);
|
||||
if (pageIndex === pageCount) {
|
||||
// clone values to oldValues
|
||||
let oldValues = JSON.parse(JSON.stringify(values));
|
||||
try {
|
||||
console.log('submit');
|
||||
// @ts-ignore // love javascript
|
||||
|
|
@ -131,9 +133,12 @@
|
|||
|
||||
values.candidate.birthdate = birthdate_formttted;
|
||||
|
||||
values.parents.filter((x) => x.name !== '' && x.surname !== '' && x.email !== '' && x.telephone !== '');
|
||||
|
||||
await apiFillDetails(values);
|
||||
goto('/dashboard');
|
||||
} catch (e) {
|
||||
values = oldValues;
|
||||
console.error('error while submitting data: ' + e);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue