updateEntity method

  1. @override
Future<PostCommentEntity> updateEntity(
  1. String documentID,
  2. PostCommentEntity value
)
override

Implementation

@override
Future<PostCommentEntity> updateEntity(
    String documentID, PostCommentEntity value) {
  return postCommentCollection
      .doc(documentID)
      .update(value.toDocument())
      .then((_) => value)
      .then((v) async {
    var newValue = await getEntity(documentID);
    if (newValue == null) {
      return value;
    } else {
      return newValue;
    }
  });
}