From b26d135a4f7d2bbbe46fb99b578649134402e667 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Sat, 7 Feb 2026 20:11:30 +0000 Subject: [PATCH] submit --- .../Components/v2/design-elements/index.tsx | 1 + client/src/Pages/Account/TabProfile.tsx | 19 ++++++------------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/client/src/Components/v2/design-elements/index.tsx b/client/src/Components/v2/design-elements/index.tsx index b7b1d484e..ebf78c61f 100644 --- a/client/src/Components/v2/design-elements/index.tsx +++ b/client/src/Components/v2/design-elements/index.tsx @@ -19,3 +19,4 @@ export * from "./Gauge"; export * from "./Tabs"; export * from "./SplitBox"; export * from "./TextLink"; +export * from "./ConfirmDialog"; diff --git a/client/src/Pages/Account/TabProfile.tsx b/client/src/Pages/Account/TabProfile.tsx index 8a9d04068..540a5b8b5 100644 --- a/client/src/Pages/Account/TabProfile.tsx +++ b/client/src/Pages/Account/TabProfile.tsx @@ -1,15 +1,13 @@ -import { useState } from "react"; import { Stack, Box } from "@mui/material"; import { useTranslation } from "react-i18next"; import { useForm, Controller } from "react-hook-form"; import { useSelector, useDispatch } from "react-redux"; -import { useNavigate } from "react-router-dom"; import { ConfigBox } from "@/Components/v2/design-elements"; import { TextField, Button } from "@/Components/v2/inputs"; import { ImageUpload } from "@/Components/v2/inputs"; import { useProfileForm } from "@/Hooks/useProfileForm"; -import { usePatch, useDelete } from "@/Hooks/UseApi"; -import { setUser, clearAuthState } from "@/Features/Auth/authSlice"; +import { usePatch } from "@/Hooks/UseApi"; +import { setUser } from "@/Features/Auth/authSlice"; import type { ProfileFormData } from "@/Validation/profile"; import type { RootState } from "@/Types/state"; import type { User } from "@/Types/User"; @@ -17,12 +15,9 @@ import type { User } from "@/Types/User"; export const TabProfile = () => { const { t } = useTranslation(); const dispatch = useDispatch(); - const navigate = useNavigate(); const user = useSelector((state: RootState) => state.auth?.user); const { resolver, defaults } = useProfileForm(); const { patch, loading: patchLoading } = usePatch(); - const { deleteFn, loading: deleteLoading } = useDelete(); - const [deleteDialogOpen, setDeleteDialogOpen] = useState(false); const { control, handleSubmit, setValue, watch } = useForm({ resolver, @@ -69,12 +64,10 @@ export const TabProfile = () => { fd.append("deleteProfileImage", "true"); } - console.log(fd); - - // const result = await patch("/auth/user", fd); - // if (result?.success && result.data) { - // dispatch(setUser(result.data)); - // } + const result = await patch("/auth/user", fd); + if (result?.success && result.data) { + dispatch(setUser(result.data)); + } }; return (