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>
This commit is contained in:
Vinoth Kumar V 2023-05-26 16:08:08 +05:30 committed by GitHub
parent 084f56d052
commit b0f1a8b942
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;
};