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:
@@ -32,7 +32,7 @@ import {
|
||||
import { Input } from '@kit/ui/input';
|
||||
import { LoadingOverlay } from '@kit/ui/loading-overlay';
|
||||
|
||||
import { impersonateUser } from '../lib/server/admin-server-actions';
|
||||
import { impersonateUserAction } from '../lib/server/admin-server-actions';
|
||||
import { ImpersonateUserSchema } from '../lib/server/schema/admin-actions.schema';
|
||||
|
||||
export function AdminImpersonateUserDialog(
|
||||
@@ -81,7 +81,7 @@ export function AdminImpersonateUserDialog(
|
||||
<form
|
||||
className={'flex flex-col space-y-8'}
|
||||
onSubmit={form.handleSubmit(async (data) => {
|
||||
const tokens = await impersonateUser(data);
|
||||
const tokens = await impersonateUserAction(data);
|
||||
|
||||
setTokens(tokens);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user