toPartialJson method

Map<String, dynamic> toPartialJson()

Converts a CommentModel to a JSON object.

Because of the way we store comments in Firestore, this only returns a partial JSON object. This is because the key of the map is the commentID. This JSON is the value of the commentID in the Firestore document.

Implementation

Map<String, dynamic> toPartialJson() => {
      'userID': userID,
      'comment': comment,
      'commentDate': commentDate,
      'isEdited': isEdited,
      'lastEdited': lastEdited,
    };