From 967d195a0519c3f0ce6ddbe02e4467cf1e3beb96 Mon Sep 17 00:00:00 2001 From: Jason Rasmussen Date: Wed, 22 May 2024 15:53:57 -0400 Subject: [PATCH] chore(server): remove unused code (#9670) --- server/src/dtos/user.dto.spec.ts | 18 +----------------- server/src/dtos/user.dto.ts | 15 --------------- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/server/src/dtos/user.dto.spec.ts b/server/src/dtos/user.dto.spec.ts index d07399f0ef..95e625a1a8 100644 --- a/server/src/dtos/user.dto.spec.ts +++ b/server/src/dtos/user.dto.spec.ts @@ -1,6 +1,6 @@ import { plainToInstance } from 'class-transformer'; import { validate } from 'class-validator'; -import { CreateAdminDto, CreateUserDto, CreateUserOAuthDto, UpdateUserDto } from 'src/dtos/user.dto'; +import { CreateUserDto, CreateUserOAuthDto, UpdateUserDto } from 'src/dtos/user.dto'; describe('update user DTO', () => { it('should allow emails without a tld', async () => { @@ -52,22 +52,6 @@ describe('create user DTO', () => { }); }); -describe('create admin DTO', () => { - it('should allow emails without a tld', async () => { - const someEmail = 'test@test'; - - const dto = plainToInstance(CreateAdminDto, { - isAdmin: true, - email: someEmail, - password: 'some password', - name: 'some name', - }); - const errors = await validate(dto); - expect(errors).toHaveLength(0); - expect(dto.email).toEqual(someEmail); - }); -}); - describe('create user oauth DTO', () => { it('should allow emails without a tld', async () => { const someEmail = 'test@test'; diff --git a/server/src/dtos/user.dto.ts b/server/src/dtos/user.dto.ts index 21cc9ae2c3..18b9d07b08 100644 --- a/server/src/dtos/user.dto.ts +++ b/server/src/dtos/user.dto.ts @@ -41,21 +41,6 @@ export class CreateUserDto { notify?: boolean; } -export class CreateAdminDto { - @IsNotEmpty() - isAdmin!: true; - - @IsEmail({ require_tld: false }) - @Transform(({ value }) => value?.toLowerCase()) - email!: string; - - @IsNotEmpty() - password!: string; - - @IsNotEmpty() - name!: string; -} - export class CreateUserOAuthDto { @IsEmail({ require_tld: false }) @Transform(({ value }) => value?.toLowerCase())