From 30efdaed176bec8e69fbdabe00036399ffacdec3 Mon Sep 17 00:00:00 2001 From: KharchenkoVladimir Date: Mon, 25 Oct 2021 12:03:24 +0500 Subject: [PATCH] CF2-85: Added error body text in register error notifications --- src/pages/Login.jsx | 2 +- src/pages/Register.jsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/Login.jsx b/src/pages/Login.jsx index 8ac6878..055497b 100644 --- a/src/pages/Login.jsx +++ b/src/pages/Login.jsx @@ -40,7 +40,7 @@ export default function Login() { history.push('well') }catch(e){ if(e.status === 400) - openNotificationError(e.message) + openNotificationError(e.body) console.error(`Error ${e}`) setErrorVisible(true) diff --git a/src/pages/Register.jsx b/src/pages/Register.jsx index e718099..a84d68b 100644 --- a/src/pages/Register.jsx +++ b/src/pages/Register.jsx @@ -95,7 +95,7 @@ export default function Register() { openNotification("Заявка на регистрацию отправлена.", 'success') history.push("/login"); }catch(e){ - openNotification(e.message, 'error') + openNotification(e.body, 'error') console.error(`Error ${e}`) setLoader(false) } @@ -158,7 +158,7 @@ export default function Register() { {createInput('name', 'Имя', false)} {createInput('surName', 'Фамилия', false)} {createInput('patronymic', 'Отчество',false)} - {createInput('email', 'Отчество',false)} + {createInput('email', 'Email',false)} {createInput('phone', 'Номер телефона',false)}