correct toJSON in case of undefined UserContact

This commit is contained in:
clauspeterhuebner 2025-12-16 22:56:23 +01:00
parent d00da185d7
commit bb69008f5f

View File

@ -17,21 +17,24 @@ export class UserContactLoggingView extends AbstractLoggingView {
public toJSON(): any { public toJSON(): any {
return { return {
id: this.self.id, self: this.self ?
type: this.self.type, {
user: id: this.self.id,
this.showUser && this.self.user type: this.self.type,
? new UserLoggingView(this.self.user).toJSON() user:
: { id: this.self.userId }, this.showUser && this.self.user
email: this.self.email?.substring(0, 3) + '...', ? new UserLoggingView(this.self.user).toJSON()
emailVerificationCode: this.self.emailVerificationCode?.substring(0, 4) + '...', : { id: this.self.userId },
emailOptInTypeId: OptInType[this.self.emailOptInTypeId], email: this.self.email?.substring(0, 3) + '...',
emailResendCount: this.self.emailResendCount, emailVerificationCode: this.self.emailVerificationCode?.substring(0, 4) + '...',
emailChecked: this.self.emailChecked, emailOptInTypeId: OptInType[this.self.emailOptInTypeId],
phone: this.self.phone ? this.self.phone.substring(0, 3) + '...' : undefined, emailResendCount: this.self.emailResendCount,
createdAt: this.dateToString(this.self.createdAt), emailChecked: this.self.emailChecked,
updatedAt: this.dateToString(this.self.updatedAt), phone: this.self.phone ? this.self.phone.substring(0, 3) + '...' : undefined,
deletedAt: this.dateToString(this.self.deletedAt), createdAt: this.dateToString(this.self.createdAt),
updatedAt: this.dateToString(this.self.updatedAt),
deletedAt: this.dateToString(this.self.deletedAt),
} : undefined
} }
} }
} }