mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-02 07:58:57 +02:00
🐛 Fix name change (#1384)
This commit is contained in:
parent
18dbb750f2
commit
c3396020cf
1 changed files with 4 additions and 2 deletions
|
@ -12,10 +12,11 @@ import { useForm } from "react-hook-form";
|
|||
import { ProfilePicture } from "@/app/[locale]/(admin)/settings/profile/profile-picture";
|
||||
import { Trans } from "@/components/trans";
|
||||
import { useUser } from "@/components/user-provider";
|
||||
import { trpc } from "@/utils/trpc/client";
|
||||
|
||||
export const ProfileSettings = () => {
|
||||
const { user, refresh } = useUser();
|
||||
|
||||
const changeName = trpc.user.changeName.useMutation();
|
||||
const form = useForm<{
|
||||
name: string;
|
||||
email: string;
|
||||
|
@ -32,7 +33,8 @@ export const ProfileSettings = () => {
|
|||
<Form {...form}>
|
||||
<form
|
||||
onSubmit={handleSubmit(async (data) => {
|
||||
await refresh({ name: data.name });
|
||||
await changeName.mutateAsync({ name: data.name });
|
||||
await refresh();
|
||||
reset(data);
|
||||
})}
|
||||
>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue