mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
make more similar
This commit is contained in:
parent
3ec740e0a5
commit
92c0c4a090
@ -21,27 +21,27 @@ export abstract class AbstractLoggingView {
|
||||
return this.toString()
|
||||
}
|
||||
|
||||
public dateToString(date: Date | undefined | null): string | undefined {
|
||||
protected dateToString(date: Date | undefined | null): string | undefined {
|
||||
if (date) {
|
||||
return date.toISOString()
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
public decimalToString(number: Decimal | undefined | null): string | undefined {
|
||||
protected decimalToString(number: Decimal | undefined | null): string | undefined {
|
||||
if (number) {
|
||||
return number.toString()
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
public timestampSecondsToDateString(timestamp: TimestampSeconds): string | undefined {
|
||||
protected timestampSecondsToDateString(timestamp: TimestampSeconds): string | undefined {
|
||||
if (timestamp && timestamp.seconds) {
|
||||
return timestampSecondsToDate(timestamp).toISOString()
|
||||
}
|
||||
}
|
||||
|
||||
public timestampToDateString(timestamp: Timestamp): string | undefined {
|
||||
protected timestampToDateString(timestamp: Timestamp): string | undefined {
|
||||
if (timestamp && (timestamp.seconds || timestamp.nanoSeconds)) {
|
||||
return timestampToDate(timestamp).toISOString()
|
||||
}
|
||||
|
||||
@ -11,8 +11,7 @@ export class AccountLoggingView extends AbstractLoggingView {
|
||||
super()
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
public toJSON(): any {
|
||||
public toJSON() {
|
||||
return {
|
||||
id: this.account.id,
|
||||
user: this.account.user ? new UserLoggingView(this.account.user).toJSON() : null,
|
||||
|
||||
@ -8,7 +8,8 @@ export class SignatureMapLoggingView extends AbstractLoggingView {
|
||||
super()
|
||||
}
|
||||
|
||||
public toJSON() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
public toJSON(): any {
|
||||
return {
|
||||
sigPair: this.self.sigPair.map((value) => new SignaturePairLoggingView(value).toJSON()),
|
||||
}
|
||||
|
||||
@ -7,7 +7,8 @@ export class SignaturePairLoggingView extends AbstractLoggingView {
|
||||
super()
|
||||
}
|
||||
|
||||
public toJSON() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
public toJSON(): any {
|
||||
return {
|
||||
pubkey: Buffer.from(this.self.pubKey).toString(this.bufferStringFormat),
|
||||
signature:
|
||||
|
||||
@ -10,7 +10,8 @@ export class TransactionDraftLoggingView extends AbstractLoggingView {
|
||||
super()
|
||||
}
|
||||
|
||||
public toJSON() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
public toJSON(): any {
|
||||
return {
|
||||
user: new UserIdentifierLoggingView(this.self.user).toJSON(),
|
||||
linkedUser: new UserIdentifierLoggingView(this.self.linkedUser).toJSON(),
|
||||
|
||||
@ -7,7 +7,8 @@ export class UserIdentifierLoggingView extends AbstractLoggingView {
|
||||
super()
|
||||
}
|
||||
|
||||
public toJSON() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
public toJSON(): any {
|
||||
return {
|
||||
uuid: this.self.uuid,
|
||||
communityUuid: this.self.communityUuid,
|
||||
|
||||
@ -7,7 +7,8 @@ export class UserLoggingView extends AbstractLoggingView {
|
||||
super()
|
||||
}
|
||||
|
||||
public toJSON() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
public toJSON(): any {
|
||||
return {
|
||||
id: this.user.id,
|
||||
gradidoId: this.user.gradidoID,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user