Skip to content

Commit 43236f8

Browse files
committed
model: Implement DmRecipientListConverter toJson method.
DmRecipientListConverter toJson was unimplemented, and just returned the list of DMRecipient objects. This changes it to return JSON representing the DMRecipients, which allows a DMMessage to be serialized and deserialized.
1 parent 2465701 commit 43236f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/api/model/model.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ class DmRecipientListConverter extends JsonConverter<List<DmRecipient>, List<dyn
383383
}
384384

385385
@override
386-
List toJson(List<DmRecipient> object) => object;
386+
List toJson(List<DmRecipient> object) => object.map((r) => r.toJson()).toList();
387387
}
388388

389389
@JsonSerializable(fieldRename: FieldRename.snake)

0 commit comments

Comments
 (0)