Replace deleteAccount with deleteUser in admin dialog
The code updates the action called when submitting the form in the 'AdminDeleteUserDialog' component. Instead of triggering 'deleteAccount', it now calls 'deleteUser'. Additionally, after a user or an account is deleted, the admin is redirected to the '/admin/accounts' route instead of receiving a 'success: true' message.
This commit is contained in:
@@ -25,7 +25,7 @@ import {
|
||||
} from '@kit/ui/form';
|
||||
import { Input } from '@kit/ui/input';
|
||||
|
||||
import { deleteAccount, deleteUser } from '../lib/server/admin-server-actions';
|
||||
import { deleteUser } from '../lib/server/admin-server-actions';
|
||||
import { DeleteUserSchema } from '../lib/server/schema/admin-actions.schema';
|
||||
|
||||
export function AdminDeleteUserDialog(
|
||||
@@ -60,7 +60,7 @@ export function AdminDeleteUserDialog(
|
||||
<form
|
||||
className={'flex flex-col space-y-8'}
|
||||
onSubmit={form.handleSubmit((data) => {
|
||||
return deleteAccount(data);
|
||||
return deleteUser(data);
|
||||
})}
|
||||
>
|
||||
<FormField
|
||||
|
||||
Reference in New Issue
Block a user