update method

  1. @override
Future<PostLikeModel> update(
  1. PostLikeModel value
)
override

Implementation

@override
Future<PostLikeModel> update(PostLikeModel value) {
  return postLikeCollection
      .doc(value.documentID)
      .update(value
          .toEntity(appId: appId)
          .copyWith(
            timestamp: FieldValue.serverTimestamp(),
          )
          .toDocument())
      .then((_) => value)
      .then((v) async {
    var newValue = await get(value.documentID);
    if (newValue == null) {
      return value;
    } else {
      return newValue;
    }
  });
}