Skip to content

Commit

Permalink
Merge branch 'feat/export-proposal' into feat/import-proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
dtscalac committed Feb 28, 2025
2 parents 168c706 + af22c6f commit c28ef04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ final class DocumentRepositoryImpl implements DocumentRepository {
);

final jsonData = documentDataDto.toJson();
return utf8.encode(json.encode(jsonData));
return json.fuse(utf8).encode(jsonData) as Uint8List;
}

@visibleForTesting
Expand Down Expand Up @@ -183,8 +183,7 @@ final class DocumentRepositoryImpl implements DocumentRepository {

@override
Future<DocumentRef> importDocument({required Uint8List data}) async {
final jsonString = utf8.decode(data);
final jsonData = json.decode(jsonString) as Map<String, dynamic>;
final jsonData = json.fuse(utf8).decode(data)! as Map<String, dynamic>;
final document = DocumentDataDto.fromJson(jsonData).toModel();

final newMetadata =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ final class DocumentDataMetadataDto {
selfRef: selfRef.toModel(),
ref: ref?.toModel(),
refHash: refHash?.toModel(),
template: template?.toModel() as SignedDocumentRef?,
template: template?.toModel(),
brandId: brandId,
campaignId: campaignId,
electionId: electionId,
Expand Down

0 comments on commit c28ef04

Please sign in to comment.