From 9c2c365da1edb2e2835d19303cdee81e53f3deb8 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Mon, 10 Apr 2023 14:43:30 +0700
Subject: fix reset password, register, search, suggest

---
 src/pages/reset-password.jsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'src/pages/reset-password.jsx')

diff --git a/src/pages/reset-password.jsx b/src/pages/reset-password.jsx
index a4aa2201..0bf6f31e 100644
--- a/src/pages/reset-password.jsx
+++ b/src/pages/reset-password.jsx
@@ -46,7 +46,7 @@ const FormComponent = () => {
   const checkValidPassword = () => {
     const passwordVal = password.current.value
     const retypePasswordVal = retypePassword.current.value
-    if (passwordVal == retypePasswordVal) {
+    if (passwordVal && passwordVal == retypePasswordVal) {
       setIsValidPassword(true)
     } else {
       setIsValidPassword(false)
@@ -56,7 +56,10 @@ const FormComponent = () => {
   const resetPasswordRequest = async (e) => {
     e.preventDefault()
     setIsLoading(true)
-    const result = await odooApi('POST', '/api/v1/user/reset-password', { token })
+    const result = await odooApi('POST', '/api/v1/user/reset-password', {
+      token,
+      password: password.current.value
+    })
     setIsLoading(false)
     password.current.value = ''
     retypePassword.current.value = ''
-- 
cgit v1.2.3

