Skip to content

Commit 5ce26e1

Browse files
committed
Include pet details in CommentModel serialization
Add a nested 'pets' object to CommentModel.toMap so serialized comments include the pet's name and profile image URL (mapped from petName and petProfileImageUrl). This allows downstream consumers to access basic pet info alongside the comment payload.
1 parent 35b9d94 commit 5ce26e1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/models/post_model.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ class CommentModel {
3636
'pet_id': petId,
3737
'text': text,
3838
'created_at': createdAt.toIso8601String(),
39+
'pets': {
40+
'name': petName,
41+
'profile_image_url': petProfileImageUrl,
42+
},
3943
};
4044
}
4145

0 commit comments

Comments
 (0)