mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
23 lines
687 B
TypeScript
23 lines
687 B
TypeScript
import { UserRole } from '../entity/UserRole'
|
|
import { AbstractLoggingView } from './AbstractLogging.view'
|
|
import { UserLoggingView } from './UserLogging.view'
|
|
|
|
export class UserRoleLoggingView extends AbstractLoggingView {
|
|
public constructor(private self: UserRole) {
|
|
super()
|
|
}
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
public toJSON(): any {
|
|
return {
|
|
id: this.self.id,
|
|
user: this.self.user
|
|
? new UserLoggingView(this.self.user).toJSON()
|
|
: { id: this.self.userId },
|
|
role: this.self.role,
|
|
createdAt: this.dateToString(this.self.createdAt),
|
|
updatedAt: this.dateToString(this.self.updatedAt),
|
|
}
|
|
}
|
|
}
|