Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backend/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { SaaSGatewayModule } from './microservices/gateways/saas-gateway.ts/saas
import { SaasModule } from './microservices/saas-microservice/saas.module.js';
import { AppLoggerMiddleware } from './middlewares/logging-middleware/app-logger-middlewate.js';
import { DatabaseModule } from './shared/database/database.module.js';
import { SharedModule } from './shared/shared.module.js';
import { GetHelloUseCase } from './use-cases-app/get-hello.use.case.js';
import { PersonalTableSettingsModule } from './entities/table-settings/personal-table-settings/personal-table-settings.module.js';
import { SavedDbQueryModule } from './entities/visualizations/saved-db-query/saved-db-query.module.js';
Expand Down Expand Up @@ -71,6 +72,7 @@ import { DashboardWidgetModule } from './entities/visualizations/dashboard-widge
UserActionModule,
CronJobsModule,
DatabaseModule,
SharedModule,
TableActionModule,
SaasModule,
CompanyInfoModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@ import { UserRoleEnum } from '../../../user/enums/user-role.enum.js';
import { IsEmail, IsEnum, IsNotEmpty, IsOptional, IsString, IsUUID } from 'class-validator';

export class InviteUserInCompanyAndConnectionGroupDto {
@IsOptional()
@IsString()
@IsNotEmpty()
@IsUUID()
@ApiProperty()
groupId: string;
@IsOptional()
@IsString()
@IsNotEmpty()
@IsUUID()
@ApiProperty()
groupId: string;

@IsString()
@IsNotEmpty()
@IsEmail()
@ApiProperty()
email: string;
@IsString()
@IsNotEmpty()
@IsEmail()
@ApiProperty()
email: string;

@IsNotEmpty()
@IsEnum(UserRoleEnum)
@ApiProperty({ enum: UserRoleEnum })
role: UserRoleEnum;
@IsNotEmpty()
@IsEnum(UserRoleEnum)
@ApiProperty({ enum: UserRoleEnum })
role: UserRoleEnum;

@ApiProperty({ description: 'Cloudflare Turnstile token for bot protection' })
@IsOptional()
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The turnstileToken field is marked as @IsOptional(), but the service throws an error when the token is missing (line 24 in turnstile.service.ts throws BadRequestException if !token). This creates inconsistent validation - the DTO says optional, but the service requires it. Either make the field required in the DTO by removing @IsOptional(), or handle the optional case properly in the service.

Suggested change
@IsOptional()
@IsNotEmpty()

Copilot uses AI. Check for mistakes.
@IsString()
turnstileToken: string;
}
Loading
Loading