addBugs method

Future<void> addBugs(
  1. BugModelCustom bugModel
)

Adds a new bug to Firestore.

Converts the bugModel to a map, adds the createdAt server timestamp, and sets the createdby field as the current user's UID.

Implementation

Future<void> addBugs(BugModelCustom bugModel) async {
  final data = bugModel.toMap();
  data['createdAt'] = FieldValue.serverTimestamp();
  data['createdby'] = FirebaseAuth.instance.currentUser!.uid;

  await bugcollection.add(data);
}