refactor: remove get-current-user GQL query

This commit is contained in:
Rıdvan Akca
2024-03-13 12:36:11 +03:00
parent 1e868dc802
commit 082e905014
9 changed files with 20 additions and 123 deletions

View File

@@ -40,7 +40,8 @@ function ProfileSettings() {
const [showDeleteAccountConfirmation, setShowDeleteAccountConfirmation] =
React.useState(false);
const enqueueSnackbar = useEnqueueSnackbar();
const { data: currentUser } = useCurrentUser();
const { data } = useCurrentUser();
const currentUser = data?.data;
const formatMessage = useFormatMessage();
const [updateCurrentUser] = useMutation(UPDATE_CURRENT_USER);
@@ -62,7 +63,7 @@ function ProfileSettings() {
optimisticResponse: {
updateCurrentUser: {
__typename: 'User',
id: currentUser?.data?.id,
id: currentUser?.id,
fullName,
email,
},
@@ -87,7 +88,7 @@ function ProfileSettings() {
<Grid item xs={12} justifyContent="flex-end">
<StyledForm
defaultValues={{
...currentUser?.data,
...currentUser,
password: '',
confirmPassword: '',
}}