Refactor admin action naming and move user assertions
Renamed the admin actions to have a more uniform approach with "Action" suffixed. This makes the action function's purpose clear in the codebase. Also, moved the `assertUserIsNotCurrentSuperAdmin` method to a more suitable place in the code, arranging it in a private scope. This helps in maintaining clean code architecture and enhances readibility.
This commit is contained in:
@@ -25,7 +25,7 @@ import {
|
||||
} from '@kit/ui/form';
|
||||
import { Input } from '@kit/ui/input';
|
||||
|
||||
import { deleteUser } from '../lib/server/admin-server-actions';
|
||||
import { deleteUserAction } 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 deleteUser(data);
|
||||
return deleteUserAction(data);
|
||||
})}
|
||||
>
|
||||
<FormField
|
||||
|
||||
Reference in New Issue
Block a user