fix get event request json
This commit is contained in:
parent
2cf42ba76e
commit
b88f636e34
1 changed files with 8 additions and 1 deletions
|
|
@ -3,14 +3,21 @@ import "package:nexus/models/room.dart";
|
|||
part "get_event_request.freezed.dart";
|
||||
part "get_event_request.g.dart";
|
||||
|
||||
@freezed
|
||||
@Freezed(toJson: false)
|
||||
abstract class GetEventRequest with _$GetEventRequest {
|
||||
const GetEventRequest._();
|
||||
const factory GetEventRequest({
|
||||
required Room room,
|
||||
required String eventId,
|
||||
@Default(false) bool unredact,
|
||||
}) = _GetEventRequest;
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"room_id": room.metadata?.id,
|
||||
"event_id": eventId,
|
||||
"unredact": unredact,
|
||||
};
|
||||
|
||||
factory GetEventRequest.fromJson(Map<String, Object?> json) =>
|
||||
_$GetEventRequestFromJson(json);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue