fix: update button fix (#9106)

* update button fix

* Update appearance.tsx

* fix linter

---------

Co-authored-by: Vinoth Kumar V <vinoth_kumar_v@Vinoths-MacBook-Pro.local>
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
pull/8925/head^2
Vinoth Kumar V 2023-05-30 20:02:15 +05:30 committed by GitHub
parent 5bca02bac2
commit 1eb873bd35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -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");

View File

@ -137,4 +137,5 @@ export const updateProfileHandler = async ({ ctx, input }: UpdateProfileOptions)
.then(() => console.info("Booking pages revalidated"))
.catch((e) => console.error(e));
}
return input;
};