addUserToParticipants method
- String activityID,
- String userId,
- ParticipantType type
Adds a user to the participants of an activity.
Implementation
Future<void> addUserToParticipants(
String activityID,
String userId,
ParticipantType type,
) async {
final value = switch (type) {
ParticipantType.going => "gaat",
ParticipantType.maybe => "misschien",
ParticipantType.notGoing => "gaat niet",
ParticipantType.undefined => null,
};
instance.collection('participants').doc(activityID).set(
{userId: value},
SetOptions(merge: true),
);
}