mirror of
https://github.com/immich-app/immich.git
synced 2025-01-21 00:52:43 -05:00
chore(server): remove unused code (#9670)
This commit is contained in:
parent
8f37784eae
commit
967d195a05
2 changed files with 1 additions and 32 deletions
|
@ -1,6 +1,6 @@
|
||||||
import { plainToInstance } from 'class-transformer';
|
import { plainToInstance } from 'class-transformer';
|
||||||
import { validate } from 'class-validator';
|
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', () => {
|
describe('update user DTO', () => {
|
||||||
it('should allow emails without a tld', async () => {
|
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', () => {
|
describe('create user oauth DTO', () => {
|
||||||
it('should allow emails without a tld', async () => {
|
it('should allow emails without a tld', async () => {
|
||||||
const someEmail = 'test@test';
|
const someEmail = 'test@test';
|
||||||
|
|
|
@ -41,21 +41,6 @@ export class CreateUserDto {
|
||||||
notify?: boolean;
|
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 {
|
export class CreateUserOAuthDto {
|
||||||
@IsEmail({ require_tld: false })
|
@IsEmail({ require_tld: false })
|
||||||
@Transform(({ value }) => value?.toLowerCase())
|
@Transform(({ value }) => value?.toLowerCase())
|
||||||
|
|
Loading…
Add table
Reference in a new issue