From 0c84d778bc2c97743605a80e1f2b6a391a14a7bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20K=C3=B6nig?= <33655937+jkoenig134@users.noreply.github.com> Date: Wed, 25 Sep 2024 11:13:26 +0200 Subject: [PATCH] Relationships `peerDeletionInfo` contains `_deletionStatus` instead of `deletionStatus` (#285) * chore: add toJson * fix: use toJSON --- .../useCases/transport/relationships/RelationshipMapper.ts | 2 +- .../src/modules/relationships/local/PeerDeletionInfo.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/runtime/src/useCases/transport/relationships/RelationshipMapper.ts b/packages/runtime/src/useCases/transport/relationships/RelationshipMapper.ts index c705d7ab8..610b825d1 100644 --- a/packages/runtime/src/useCases/transport/relationships/RelationshipMapper.ts +++ b/packages/runtime/src/useCases/transport/relationships/RelationshipMapper.ts @@ -16,7 +16,7 @@ export class RelationshipMapper { template: RelationshipTemplateMapper.toRelationshipTemplateDTO(relationship.cache.template), status: relationship.status, peer: relationship.peer.address.toString(), - peerDeletionInfo: relationship.peerDeletionInfo, + peerDeletionInfo: relationship.peerDeletionInfo?.toJSON(), peerIdentity: { address: relationship.peer.address.toString(), publicKey: relationship.peer.publicKey.toBase64(false) diff --git a/packages/transport/src/modules/relationships/local/PeerDeletionInfo.ts b/packages/transport/src/modules/relationships/local/PeerDeletionInfo.ts index 007a9d55a..0213c5861 100644 --- a/packages/transport/src/modules/relationships/local/PeerDeletionInfo.ts +++ b/packages/transport/src/modules/relationships/local/PeerDeletionInfo.ts @@ -23,4 +23,8 @@ export class PeerDeletionInfo extends Serializable implements IPeerDeletionInfo public static from(value: IPeerDeletionInfo | PeerDeletionInfoJSON): PeerDeletionInfo { return this.fromAny(value); } + + public override toJSON(): PeerDeletionInfoJSON { + return super.toJSON() as PeerDeletionInfoJSON; + } }