Skip to content

Commit

Permalink
model: Implement DmRecipientListConverter toJson method.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
oxling committed Jul 24, 2023
1 parent 2465701 commit 8d541cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/api/model/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ class DmRecipientListConverter extends JsonConverter<List<DmRecipient>, List<dyn
}

@override
List toJson(List<DmRecipient> object) => object;
List toJson(List<DmRecipient> object) => object.map((r) => r.toJson()).toList();
}

@JsonSerializable(fieldRename: FieldRename.snake)
Expand Down

0 comments on commit 8d541cc

Please sign in to comment.