fix: handle null values in User email transform (#1712)

This commit is contained in:
TheCatLady
2021-05-31 01:36:40 -04:00
committed by GitHub
parent 59b2ec11fa
commit 4a042f12be

View File

@@ -51,8 +51,8 @@ export class User {
@Column({
unique: true,
transformer: {
from: (value: string): string => value.toLowerCase(),
to: (value: string): string => value.toLowerCase(),
from: (value: string): string => (value ?? '').toLowerCase(),
to: (value: string): string => (value ?? '').toLowerCase(),
},
})
public email: string;