From 1eb873bd35e53b40e30f1d28b6ff07fb65a72048 Mon Sep 17 00:00:00 2001 From: Vinoth Kumar V <123581387+VinoV1999@users.noreply.github.com> Date: Tue, 30 May 2023 20:02:15 +0530 Subject: [PATCH] fix: update button fix (#9106) * update button fix * Update appearance.tsx * fix linter --------- Co-authored-by: Vinoth Kumar V Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com> Co-authored-by: Peer Richelsen Co-authored-by: Hariom Balhara --- apps/web/pages/settings/my-account/appearance.tsx | 4 +++- .../server/routers/loggedInViewer/updateProfile.handler.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/web/pages/settings/my-account/appearance.tsx b/apps/web/pages/settings/my-account/appearance.tsx index cff2e5901d..deadaaaaea 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 7d9debf1e4..67983b3b15 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; };