approvePost method

Future<void> approvePost(
  1. String id
)

Approves a post with the given id.

Implementation

Future<void> approvePost(String id) async {
  instance
      .collection('posts')
      .doc(id)
      .update({"approved": true, "postDate": DateTime.now()}).catchError(
    (error) {
      debugPrint("Error approving post: $error");
    },
  );
}