dashboard: fix toaster
This commit is contained in:
@@ -25,13 +25,12 @@ export default function EditOrganization({
|
||||
const router = useRouter();
|
||||
|
||||
const { register, handleSubmit, formState, reset } = useForm<IForm>({
|
||||
defaultValues: organization,
|
||||
defaultValues: organization ?? undefined,
|
||||
});
|
||||
|
||||
const mutation = api.organization.update.useMutation({
|
||||
onSuccess(res) {
|
||||
toast({
|
||||
title: 'Organization updated',
|
||||
toast('Organization updated', {
|
||||
description: 'Your organization has been updated.',
|
||||
});
|
||||
reset(res);
|
||||
@@ -57,7 +56,7 @@ export default function EditOrganization({
|
||||
<InputWithLabel
|
||||
label="Name"
|
||||
{...register('name')}
|
||||
defaultValue={organization.name}
|
||||
defaultValue={organization?.name}
|
||||
/>
|
||||
</WidgetBody>
|
||||
</Widget>
|
||||
|
||||
@@ -27,8 +27,7 @@ export function InviteUser() {
|
||||
|
||||
const mutation = api.organization.inviteUser.useMutation({
|
||||
onSuccess() {
|
||||
toast({
|
||||
title: 'User invited!',
|
||||
toast('User invited!', {
|
||||
description: 'The user has been invited to the organization.',
|
||||
});
|
||||
reset();
|
||||
|
||||
@@ -35,8 +35,7 @@ export default function EditProfile({ profile }: EditProfileProps) {
|
||||
|
||||
const mutation = api.user.update.useMutation({
|
||||
onSuccess(res) {
|
||||
toast({
|
||||
title: 'Profile updated',
|
||||
toast('Profile updated', {
|
||||
description: 'Your profile has been updated.',
|
||||
});
|
||||
reset(res);
|
||||
|
||||
Reference in New Issue
Block a user