fix: user profile data mutation (#1243)

This commit is contained in:
Aaryan Khandelwal 2023-06-07 19:03:49 +05:30 committed by GitHub
parent e949c4e130
commit 42fceb4dcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -67,7 +67,7 @@ const Profile: NextPage = () => {
.then((res) => {
mutateUser((prevData) => {
if (!prevData) return prevData;
return { ...prevData, user: { ...payload, ...res } };
return { ...prevData, ...res };
}, false);
setIsEditing(false);
setToastAlert({
@ -97,7 +97,7 @@ const Profile: NextPage = () => {
if (updateUser)
userService
.updateUser({ avatar: "" })
.then((res) => {
.then(() => {
setToastAlert({
type: "success",
title: "Success!",
@ -105,7 +105,7 @@ const Profile: NextPage = () => {
});
mutateUser((prevData) => {
if (!prevData) return prevData;
return { ...prevData, user: res };
return { ...prevData, avatar: "" };
}, false);
})
.catch(() => {

View File

@ -191,8 +191,8 @@ const WorkspaceSettings: NextPage = () => {
<div className="relative mx-auto flex h-12 w-12">
<img
src={watch("logo")!}
alt="Workspace Logo"
className="absolute top-0 left-0 h-full w-full object-cover rounded-md"
alt="Workspace Logo"
/>
</div>
) : (