Fix change password page

This commit is contained in:
ariari04 2024-09-25 22:01:04 +06:00
parent 813a0bbc77
commit 91b2a5024e
2 changed files with 5 additions and 5 deletions

View File

@ -1,10 +1,10 @@
import Link from "next/link";
import { useState } from "react"; import { useState } from "react";
import { apiInstance } from "@/shared/config/apiConfig"; import { apiInstance } from "@/shared/config/apiConfig";
import { useSession } from "next-auth/react"; import { useSession } from "next-auth/react";
import { AxiosError } from "axios"; import { AxiosError } from "axios";
import Loader from "@/shared/ui/Loader/Loader"; import Loader from "@/shared/ui/Loader/Loader";
import ChangePasswordInput from "./ChangePasswordInput/ChangePasswordInput"; import ChangePasswordInput from "./ChangePasswordInput/ChangePasswordInput";
import { Link } from "@/shared/config/navigation";
interface IChangePasswordProps { interface IChangePasswordProps {
closeWindow: (bool: boolean) => void; closeWindow: (bool: boolean) => void;
@ -79,7 +79,7 @@ const ChangePassword: React.FC<IChangePasswordProps> = ({
setWarningConfirmNewPassword(""); setWarningConfirmNewPassword("");
setLoader(true); setLoader(true);
const res = await apiInstance.patch( const res = await apiInstance.patch(
"/users/change_password/", "/auth/password_change/",
data, data,
config config
); );
@ -146,12 +146,12 @@ const ChangePassword: React.FC<IChangePasswordProps> = ({
<button <button
type="button" type="button"
onClick={changePass} onClick={changePass}
className="py-4 px-4 rounded-sm font-bold leading-6 shadow-sm border border-blue bg-blue text-white" className="py-3 px-4 rounded-md font-bold leading-6 shadow-sm border border-blue bg-blue text-white"
> >
{loader ? <Loader /> : "Сохранить"} {loader ? <Loader /> : "Сохранить"}
</button> </button>
<button <button
className="py-4 px-4 rounded-sm font-bold leading-6 shadow-sm border border-gray-400 bg-slate-200 text-gray-500" className="py-3 px-4 rounded-md font-bold leading-6 shadow-md border border-gray-300 bg-slate-200 text-gray-500"
type="button" type="button"
onClick={() => closeWindow(false)} onClick={() => closeWindow(false)}
> >

View File

@ -34,7 +34,7 @@ const ChangePasswordInput: React.FC<IChangePasswordInputProps> = ({
name={name} name={name}
placeholder={placeholder} placeholder={placeholder}
type={isOpen ? "text" : "password"} type={isOpen ? "text" : "password"}
className="w-full text-[14px] placeholder:leading-6 bg-gray-500" className="w-full text-[14px] placeholder:leading-6 bg-gray-200"
/> />
<button onClick={() => setIsOpen((prev) => !prev)} type="button"> <button onClick={() => setIsOpen((prev) => !prev)} type="button">
<Image src={isOpen ? eye_on : eye_off} alt="Eye Icon" /> <Image src={isOpen ? eye_on : eye_off} alt="Eye Icon" />