From 139c0a3e3c7c51c2e8e6191ac8971d96897a62fc Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Sun, 19 Nov 2023 16:11:49 +0800 Subject: [PATCH] Renamed authentication method --- src/Components/LoginModal/LoginModal.tsx | 4 ++-- src/Components/Plugins/Redux/Slices/AuthSlice/AuthSlice.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Components/LoginModal/LoginModal.tsx b/src/Components/LoginModal/LoginModal.tsx index 85a70ad..e5f9d34 100644 --- a/src/Components/LoginModal/LoginModal.tsx +++ b/src/Components/LoginModal/LoginModal.tsx @@ -12,7 +12,7 @@ import Button from "../Buttons/Button"; import { useNavigate } from "react-router-dom"; import { LoginAPI } from "../API/API"; import { useDispatch } from "react-redux"; -import { Toggle_Login } from "../Plugins/Redux/Slices/AuthSlice/AuthSlice"; +import { auth_toggle } from "../Plugins/Redux/Slices/AuthSlice/AuthSlice"; export default function LoginModal() { const navigate = useNavigate(); const [showPassword, setShowPassword] = useState(false); @@ -128,7 +128,7 @@ export default function LoginModal() { onClick={async () => { const status = await LoginAPI(user); if (status === true) { - await dispatch(Toggle_Login()); + await dispatch(auth_toggle()); navigate("/dashboard"); } else { setError("Invalid login"); diff --git a/src/Components/Plugins/Redux/Slices/AuthSlice/AuthSlice.tsx b/src/Components/Plugins/Redux/Slices/AuthSlice/AuthSlice.tsx index 691a08e..bab1c91 100644 --- a/src/Components/Plugins/Redux/Slices/AuthSlice/AuthSlice.tsx +++ b/src/Components/Plugins/Redux/Slices/AuthSlice/AuthSlice.tsx @@ -7,13 +7,13 @@ export const AuthSlice = createSlice({ value: false, }, reducers: { - Toggle_Login: (state) => { + auth_toggle: (state) => { state.value = !state.value; }, }, }); // Action creators are generated for each case reducer function -export const { Toggle_Login } = AuthSlice.actions; +export const { auth_toggle } = AuthSlice.actions; export default AuthSlice.reducer;