From f3a8fda254221c24d95a44d22405f9429e85229c Mon Sep 17 00:00:00 2001 From: Sheen Capadngan Date: Mon, 8 Jul 2024 15:16:10 +0800 Subject: [PATCH] misc: resolved conflict with existing method --- frontend/src/hooks/api/users/index.tsx | 1 + frontend/src/hooks/api/users/queries.tsx | 2 +- .../DeleteAccountSection/DeleteAccountSection.tsx | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/hooks/api/users/index.tsx b/frontend/src/hooks/api/users/index.tsx index 87cf7c78f..b7e8d6be3 100644 --- a/frontend/src/hooks/api/users/index.tsx +++ b/frontend/src/hooks/api/users/index.tsx @@ -10,6 +10,7 @@ export { useAddUserToOrg, useCreateAPIKey, useDeleteAPIKey, + useDeleteMe, useDeleteOrgMembership, useGetMyAPIKeys, useGetMyAPIKeysV2, diff --git a/frontend/src/hooks/api/users/queries.tsx b/frontend/src/hooks/api/users/queries.tsx index 962961bc2..bee58027c 100644 --- a/frontend/src/hooks/api/users/queries.tsx +++ b/frontend/src/hooks/api/users/queries.tsx @@ -49,7 +49,7 @@ export const fetchUsersList = async () => { export const useListUsers = () => useQuery(userKeys.listUsers, fetchUsersList); -export const useDeleteUser = () => { +export const useDeleteMe = () => { const queryClient = useQueryClient(); return useMutation({ diff --git a/frontend/src/views/Settings/PersonalSettingsPage/DeleteAccountSection/DeleteAccountSection.tsx b/frontend/src/views/Settings/PersonalSettingsPage/DeleteAccountSection/DeleteAccountSection.tsx index 49908eabc..fab1057ba 100644 --- a/frontend/src/views/Settings/PersonalSettingsPage/DeleteAccountSection/DeleteAccountSection.tsx +++ b/frontend/src/views/Settings/PersonalSettingsPage/DeleteAccountSection/DeleteAccountSection.tsx @@ -2,17 +2,17 @@ import { useRouter } from "next/router"; import { createNotification } from "@app/components/notifications"; import { Button, DeleteActionModal } from "@app/components/v2"; -import { useDeleteUser } from "@app/hooks/api"; +import { useDeleteMe } from "@app/hooks/api"; import { usePopUp } from "@app/hooks/usePopUp"; export const DeleteAccountSection = () => { const router = useRouter(); - + const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([ "deleteAccount" ] as const); - const { mutateAsync: deleteUserMutateAsync, isLoading } = useDeleteUser(); + const { mutateAsync: deleteUserMutateAsync, isLoading } = useDeleteMe(); const handleDeleteAccountSubmit = async () => { try {