This commit is contained in:
batche
2022-10-28 16:01:21 +02:00
parent 2619eb42e1
commit e401665e71
14 changed files with 22 additions and 37 deletions

View File

@@ -25,7 +25,7 @@ import { AuthenticationController } from './auth/authentication.controller';
synchronize: true,
}),
],
controllers: [AppController, AuthenticationController],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}

View File

@@ -11,4 +11,5 @@ import { User } from '../users/entities/user.entity';
controllers: [FriendshipController],
exports: [FriendshipService],
})
export class FriendshipsModule {}

View File

@@ -2,13 +2,11 @@ import { Exclude } from 'class-transformer';
import { IsEmail, IsString } from 'class-validator';
export class CreateUsersDto {
@IsString()
readonly name: string;
@IsString()
readonly username: string;
@IsEmail()
readonly email: string;
@IsString()
@Exclude()
readonly password: string;
@IsEmail()
readonly email: string;
}

View File

@@ -4,8 +4,8 @@ import { Column, Entity, JoinTable, ManyToMany, OneToMany, PrimaryGeneratedColum
import { Friendship } from "../../friendship/entities/friendship.entity";
@Entity('users')
@Unique(['email', 'username'])
@Entity('user')
// @Unique(['email', 'username'])
export class User {
@PrimaryGeneratedColumn()
@@ -23,7 +23,7 @@ export class User {
//Dans le cadre d'un tableau on peut faire :
// @Column('json', { nullable: true })
@Column()
@Exclude()
// @Exclude()
password: string;
@Column('json', { nullable: true })
@@ -37,7 +37,7 @@ export class User {
@OneToMany(type => Friendship , (friendship) => friendship.addresseeId)
addresseeId: Friendship[];
constructor(partial: Partial<User>) {
Object.assign(this, partial);
}
// constructor(partial: Partial<User>) {
// Object.assign(this, partial);
// }
}