1
0
mirror of https://github.com/immich-app/immich.git synced 2025-01-01 11:37:06 +02:00

chore(server): remove unused code (#9670)

This commit is contained in:
Jason Rasmussen 2024-05-22 15:53:57 -04:00 committed by GitHub
parent 8f37784eae
commit 967d195a05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 32 deletions

View File

@ -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';

View File

@ -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())