B2B-30: minor fixes, renamings
This commit is contained in:
@@ -30,7 +30,7 @@ import { If } from '@kit/ui/if';
|
||||
import { Input } from '@kit/ui/input';
|
||||
import { toast } from '@kit/ui/sonner';
|
||||
|
||||
import { createTeamAccountAction } from '../lib/server/admin-server-actions';
|
||||
import { createCompanyAccountAction } from '../lib/server/admin-server-actions';
|
||||
import { CreateCompanySchema, CreateCompanySchemaType } from '../lib/server/schema/create-company.schema';
|
||||
import { Trans } from '@kit/ui/trans';
|
||||
|
||||
@@ -50,7 +50,7 @@ export function AdminCreateCompanyDialog(props: React.PropsWithChildren) {
|
||||
const onSubmit = (data: CreateCompanySchemaType) => {
|
||||
startTransition(async () => {
|
||||
try {
|
||||
const error = await createTeamAccountAction(data);
|
||||
const error = await createCompanyAccountAction(data);
|
||||
|
||||
if (!error) {
|
||||
toast.success('Company creates successfully');
|
||||
|
||||
@@ -21,7 +21,7 @@ import { createAdminAccountsService } from './services/admin-accounts.service';
|
||||
import { createAdminAuthUserService } from './services/admin-auth-user.service';
|
||||
import { adminAction } from './utils/admin-action';
|
||||
import { CreateCompanySchema } from './schema/create-company.schema';
|
||||
import { createCreateTeamAccountService } from './services/create-team-account.service';
|
||||
import { createCreateCompanyAccountService } from './services/admin-create-company-account.service';
|
||||
|
||||
/**
|
||||
* @name banUserAction
|
||||
@@ -224,11 +224,11 @@ export const resetPasswordAction = adminAction(
|
||||
),
|
||||
);
|
||||
|
||||
export const createTeamAccountAction = enhanceAction(
|
||||
export const createCompanyAccountAction = enhanceAction(
|
||||
async ({ name }, user) => {
|
||||
const logger = await getLogger();
|
||||
const client = getSupabaseServerClient();
|
||||
const service = createCreateTeamAccountService(client);
|
||||
const service = createCreateCompanyAccountService(client);
|
||||
|
||||
const ctx = {
|
||||
name: 'team-accounts.create',
|
||||
|
||||
@@ -5,7 +5,7 @@ import { SupabaseClient } from '@supabase/supabase-js';
|
||||
import { getLogger } from '@kit/shared/logger';
|
||||
import { Database } from '@kit/supabase/database';
|
||||
|
||||
export function createCreateTeamAccountService(
|
||||
export function createCreateCompanyAccountService(
|
||||
client: SupabaseClient<Database>,
|
||||
) {
|
||||
return new CreateTeamAccountService(client);
|
||||
Reference in New Issue
Block a user