diff --git a/apps/api/src/app/organization/organization.controller.ts b/apps/api/src/app/organization/organization.controller.ts index 498988f3bfb..90203052913 100644 --- a/apps/api/src/app/organization/organization.controller.ts +++ b/apps/api/src/app/organization/organization.controller.ts @@ -159,6 +159,7 @@ export class OrganizationController { } @Put('/') + @Roles(MemberRoleEnum.ADMIN) async updateOrganization(@UserSession() user: IJwtPayload, @Body() body: { name: string }) { return await this.updateOrganizationUsecase.execute( UpdateOrganizationCommand.create({ diff --git a/apps/api/src/app/organization/usecases/update-organization/update-organization-command.ts b/apps/api/src/app/organization/usecases/update-organization/update-organization-command.ts index cb3f1dfd6f0..0c8b2d0893a 100644 --- a/apps/api/src/app/organization/usecases/update-organization/update-organization-command.ts +++ b/apps/api/src/app/organization/usecases/update-organization/update-organization-command.ts @@ -1,9 +1,10 @@ -import { IsDefined } from 'class-validator'; +import { IsDefined, MaxLength } from 'class-validator'; import { AuthenticatedCommand } from '../../../shared/commands/authenticated.command'; export class UpdateOrganizationCommand extends AuthenticatedCommand { @IsDefined() public readonly id: string; + @MaxLength(50) name: string; }