aboutsummaryrefslogtreecommitdiffstats
path: root/helpers/submitForm.js
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/submitForm.js')
-rw-r--r--helpers/submitForm.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/helpers/submitForm.js b/helpers/submitForm.js
index 631c174..d67a7dc 100644
--- a/helpers/submitForm.js
+++ b/helpers/submitForm.js
@@ -5,9 +5,9 @@ const submitForm = async (e, url, mutateUser, setErrorMsg) => {
const isRegister = url.includes('register')
if (
- isRegister && e.currentTarget.password_confirm
- && e.currentTarget.password_confirm.value
- !== e.currentTarget.password.value
+ isRegister && e.currentTarget.password_confirm &&
+ e.currentTarget.password_confirm.value !==
+ e.currentTarget.password.value
) {
setErrorMsg('passwords_not_match')
return
@@ -19,13 +19,13 @@ const submitForm = async (e, url, mutateUser, setErrorMsg) => {
email: e.currentTarget.email.value,
password: e.currentTarget.password.value,
...(e.currentTarget.language
- ? {language: e.currentTarget.language.value}
+ ? { language: e.currentTarget.language.value }
: {}
),
...(e.currentTarget.theme
- ? {theme: e.currentTarget.theme.value}
+ ? { theme: e.currentTarget.theme.value }
: {}
- ),
+ )
}
try {
@@ -33,7 +33,7 @@ const submitForm = async (e, url, mutateUser, setErrorMsg) => {
await fetchJson(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify(body),
+ body: JSON.stringify(body)
})
)
} catch (err) {