Skip to content

Scheduling infrastructure for absolutely everyone.

fix: update button fix (#9106)

Vinoth Kumar V1eb873bd35e5
diff --git a/apps/web/pages/settings/my-account/appearance.tsx b/apps/web/pages/settings/my-account/appearance.tsx
index cff2e5901d1..deadaaaaea5 100644
--- a/apps/web/pages/settings/my-account/appearance.tsx
+++ b/apps/web/pages/settings/my-account/appearance.tsx
@@ -67,12 +67,14 @@ const AppearanceView = () => {
const {
formState: { isSubmitting, isDirty },
+ reset,
} = formMethods;
const mutation = trpc.viewer.updateProfile.useMutation({
- onSuccess: async () => {
+ onSuccess: async (data) => {
await utils.viewer.me.invalidate();
showToast(t("settings_updated_successfully"), "success");
+ reset(data);
},
onError: () => {
showToast(t("error_updating_settings"), "error");
diff --git a/packages/trpc/server/routers/loggedInViewer/updateProfile.handler.ts b/packages/trpc/server/routers/loggedInViewer/updateProfile.handler.ts
index 7d9debf1e43..67983b3b155 100644
--- a/packages/trpc/server/routers/loggedInViewer/updateProfile.handler.ts
+++ b/packages/trpc/server/routers/loggedInViewer/updateProfile.handler.ts
@@ -137,4 +137,5 @@ export const updateProfileHandler = async ({ ctx, input }: UpdateProfileOptions)
.then(() => console.info("Booking pages revalidated"))
.catch((e) => console.error(e));
}
+ return input;
};