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:
parent
8f37784eae
commit
967d195a05
@ -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';
|
||||
|
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user