From be0f954ff3e0f7b6ddcf3cf8ce20e68445c366bc Mon Sep 17 00:00:00 2001 From: Dilmurod Date: Mon, 5 Jan 2026 18:10:35 +0500 Subject: [PATCH] reset password navigation bug fixed & Added salary_rate field to user edit form --- src/API/LayoutApi/profile.ts | 3 +-- src/Auth/ResetByEmail.tsx | 25 ++++++++----------------- src/Components/Users/UserEdit.tsx | 12 ++++++++++++ 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/API/LayoutApi/profile.ts b/src/API/LayoutApi/profile.ts index 6b1221b..88df074 100644 --- a/src/API/LayoutApi/profile.ts +++ b/src/API/LayoutApi/profile.ts @@ -77,8 +77,7 @@ export const prof = { } catch (error: any) { setTimeout(() => { message.error({ - content: error.response.data.username, - key: 2, + content: "Something went wrong", duration: 2, }); }, 1000); diff --git a/src/Auth/ResetByEmail.tsx b/src/Auth/ResetByEmail.tsx index 32b2f45..945a7f0 100644 --- a/src/Auth/ResetByEmail.tsx +++ b/src/Auth/ResetByEmail.tsx @@ -3,7 +3,7 @@ import { Button, Space, Card, Form, Input } from "antd"; import { LockOutlined } from "@ant-design/icons"; import { common } from "../Utils/common"; -import { Navigate, useLocation } from "react-router-dom"; +import { useNavigate, useLocation } from "react-router-dom"; import { resetPassEmail } from "../API/auth/resetPass"; const ResetByEmail: React.FC = () => { @@ -12,29 +12,20 @@ const ResetByEmail: React.FC = () => { const queryParameters = new URLSearchParams(location.search); const confirmation_token = queryParameters.get("confirmation_token"); const user_id = queryParameters.get("user_id"); + const navigate = useNavigate(); const onFinish = (values: any) => { values.confirmation_token = confirmation_token; values.user_id = user_id; - if(values.user_id){ - resetPassEmail(values).then(() => { - - }); + if (values.user_id) { + resetPassEmail(values).then(() => { + navigate("/#/auth/login"); + }); } - }; return (
-
+ { > diff --git a/src/Components/Users/UserEdit.tsx b/src/Components/Users/UserEdit.tsx index d5f823e..c3d8f2a 100644 --- a/src/Components/Users/UserEdit.tsx +++ b/src/Components/Users/UserEdit.tsx @@ -235,6 +235,18 @@ const UserEdit = () => { } /> )} + + {role === "Owner" && ( + + + } /> + + + )} {role !== "Checker" && (