From c60762218594d25ebc9b14951249d360143b194e Mon Sep 17 00:00:00 2001 From: Alex <$(pass /github/email)> Date: Wed, 26 Feb 2025 21:37:27 +0100 Subject: [PATCH] nomenclature nomenclature --- frontend/src/lib/components/UserEditForm.svelte | 16 ++++++++-------- frontend/src/lib/utils/processing.js | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/frontend/src/lib/components/UserEditForm.svelte b/frontend/src/lib/components/UserEditForm.svelte index 022761f..a428372 100644 --- a/frontend/src/lib/components/UserEditForm.svelte +++ b/frontend/src/lib/components/UserEditForm.svelte @@ -127,7 +127,7 @@ let isUpdating = false, password = '', - password2 = ''; + confirm_password = ''; /** @type {Object.} */ $: groupedCategories = groupCategories(licence_categories); @@ -249,14 +249,14 @@ label={$t('password')} placeholder={$t('placeholder.password')} bind:value={password} - otherPasswordValue={password2} + otherPasswordValue={confirm_password} /> | Partial, password2: string }} Nested object representation of the form data + * @returns {{ object: Partial | Partial, confirm_password: string }} Nested object representation of the form data */ export function formDataToObject(formData) { /** @type { Partial | Partial } */ const object = {}; - let password2 = ''; + let confirm_password = ''; console.log('Form data entries:'); for (const [key, value] of formData.entries()) { console.log('Key:', key, 'Value:', value); - if (key == 'password2') { - password2 = String(value); + if (key == 'confirm_password') { + confirm_password = String(value); continue; } /** @type {string[]} */ @@ -56,12 +56,12 @@ export function formDataToObject(formData) { } } - return { object: object, password2: password2 }; + return { object: object, confirm_password: confirm_password }; } /** * Processes the raw form data into the expected user data structure - * @param {{ object: Partial, password2: string} } rawData - The raw form data object + * @param {{ object: Partial, confirm_password: string} } rawData - The raw form data object * @returns {{ user: Partial }} Processed user data */ export function processUserFormData(rawData) { @@ -130,8 +130,8 @@ export function processUserFormData(rawData) { console.dir(rawData.object.licence); if ( rawData.object.password && - rawData.password2 && - rawData.object.password === rawData.password2 && + rawData.confirm_password && + rawData.object.password === rawData.confirm_password && rawData.object.password.trim() !== '' ) { processedData.user.password = rawData.object.password;