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 { Input } from '@kit/ui/input';
|
||||||
import { toast } from '@kit/ui/sonner';
|
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 { CreateCompanySchema, CreateCompanySchemaType } from '../lib/server/schema/create-company.schema';
|
||||||
import { Trans } from '@kit/ui/trans';
|
import { Trans } from '@kit/ui/trans';
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ export function AdminCreateCompanyDialog(props: React.PropsWithChildren) {
|
|||||||
const onSubmit = (data: CreateCompanySchemaType) => {
|
const onSubmit = (data: CreateCompanySchemaType) => {
|
||||||
startTransition(async () => {
|
startTransition(async () => {
|
||||||
try {
|
try {
|
||||||
const error = await createTeamAccountAction(data);
|
const error = await createCompanyAccountAction(data);
|
||||||
|
|
||||||
if (!error) {
|
if (!error) {
|
||||||
toast.success('Company creates successfully');
|
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 { createAdminAuthUserService } from './services/admin-auth-user.service';
|
||||||
import { adminAction } from './utils/admin-action';
|
import { adminAction } from './utils/admin-action';
|
||||||
import { CreateCompanySchema } from './schema/create-company.schema';
|
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
|
* @name banUserAction
|
||||||
@@ -224,11 +224,11 @@ export const resetPasswordAction = adminAction(
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
export const createTeamAccountAction = enhanceAction(
|
export const createCompanyAccountAction = enhanceAction(
|
||||||
async ({ name }, user) => {
|
async ({ name }, user) => {
|
||||||
const logger = await getLogger();
|
const logger = await getLogger();
|
||||||
const client = getSupabaseServerClient();
|
const client = getSupabaseServerClient();
|
||||||
const service = createCreateTeamAccountService(client);
|
const service = createCreateCompanyAccountService(client);
|
||||||
|
|
||||||
const ctx = {
|
const ctx = {
|
||||||
name: 'team-accounts.create',
|
name: 'team-accounts.create',
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { SupabaseClient } from '@supabase/supabase-js';
|
|||||||
import { getLogger } from '@kit/shared/logger';
|
import { getLogger } from '@kit/shared/logger';
|
||||||
import { Database } from '@kit/supabase/database';
|
import { Database } from '@kit/supabase/database';
|
||||||
|
|
||||||
export function createCreateTeamAccountService(
|
export function createCreateCompanyAccountService(
|
||||||
client: SupabaseClient<Database>,
|
client: SupabaseClient<Database>,
|
||||||
) {
|
) {
|
||||||
return new CreateTeamAccountService(client);
|
return new CreateTeamAccountService(client);
|
||||||
@@ -82,7 +82,7 @@ port = 54324
|
|||||||
# Uncomment to expose additional ports for testing user applications that send emails.
|
# Uncomment to expose additional ports for testing user applications that send emails.
|
||||||
# smtp_port = 54325
|
# smtp_port = 54325
|
||||||
# pop3_port = 54326
|
# pop3_port = 54326
|
||||||
# admin_email = "info@devmc.ee"
|
# admin_email = ""
|
||||||
# sender_name = "Admin"
|
# sender_name = "Admin"
|
||||||
|
|
||||||
[storage]
|
[storage]
|
||||||
|
|||||||
Reference in New Issue
Block a user