📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
Validation fixes
Blue Mouse83419cbb1033
diff --git a/backend/apps/production/src/project/dto/bulk-add-users.dto.ts b/backend/apps/production/src/project/dto/bulk-add-users.dto.tsindex 11d4b5bd6..00354ebfb 100644--- a/backend/apps/production/src/project/dto/bulk-add-users.dto.ts+++ b/backend/apps/production/src/project/dto/bulk-add-users.dto.ts@@ -4,9 +4,12 @@ import {IsArray,ValidateNested,ArrayMinSize,+ IsEnum,+ IsEmail,} from 'class-validator'import { Type } from 'class-transformer'+import { ValidateProjectIds } from '../../analytics/decorators/validate-project-ids.decorator'import { Role } from '../entity/project-share.entity'class UserProjectAccess {@@ -15,6 +18,7 @@ class UserProjectAccess {description: 'User you want to invite to your project',})@IsNotEmpty()+ @IsEmail()email: string@ApiProperty({@@ -22,6 +26,7 @@ class UserProjectAccess {description: 'Users role in your project',})@IsNotEmpty()+ @IsEnum(Role)role: Role@ApiProperty({@@ -31,6 +36,7 @@ class UserProjectAccess {@IsArray()@IsNotEmpty()@ArrayMinSize(1)+ @ValidateProjectIds()projectIds: string[]}diff --git a/backend/apps/production/src/project/project.controller.ts b/backend/apps/production/src/project/project.controller.tsindex 6fd414d1a..602c22640 100644--- a/backend/apps/production/src/project/project.controller.ts+++ b/backend/apps/production/src/project/project.controller.ts@@ -1078,7 +1078,9 @@ export class ProjectController {const failedProjectIds = []- for (const pid of invitationObject.projectIds) {+ const uniqueProjectIds = [...new Set(invitationObject.projectIds)]++ for (const pid of uniqueProjectIds) {if (!isValidPID(pid)) {this.logger.warn(`Invalid project ID: ${pid}`)failedProjectIds.push({diff --git a/backend/apps/production/src/user/user.controller.ts b/backend/apps/production/src/user/user.controller.tsindex f2bf9f76e..d495fd04c 100644--- a/backend/apps/production/src/user/user.controller.ts+++ b/backend/apps/production/src/user/user.controller.ts@@ -341,6 +341,8 @@ export class UserController {await Promise.all(promises)}await this.actionTokensService.deleteMultiple(`userId="${id}"`)+ await this.userService.deleteAllRefreshTokens(id)+ await this.projectService.deleteMultipleShare(`userId="${id}"`)await this.userService.delete(id)return 'accountDeleted'@@ -366,6 +368,10 @@ export class UserController {select: ['id', 'planCode'],})+ if (_isEmpty(user)) {+ throw new BadRequestException('User not found')+ }+if (!_includes(UNPAID_PLANS, user.planCode)) {throw new BadRequestException('cancelSubFirst')}@@ -393,6 +399,8 @@ export class UserController {await Promise.all(promises)}await this.actionTokensService.deleteMultiple(`userId="${id}"`)+ await this.userService.deleteAllRefreshTokens(id)+ await this.projectService.deleteMultipleShare(`userId="${id}"`)await this.userService.delete(id)} catch (e) {this.logger.error(e)