You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
408 B
16 lines
408 B
import 'package:cloud_firestore/cloud_firestore.dart';
|
|
|
|
import '../model/User.dart';
|
|
import '../main.dart';
|
|
|
|
class UserService {
|
|
acceptFriend(User user, String idFriend) {
|
|
MyApp.db.collection("users").doc(user.id).update({
|
|
"friends": FieldValue.arrayUnion([idFriend])
|
|
});
|
|
MyApp.db.collection("users").doc(idFriend).update({
|
|
"friends": FieldValue.arrayUnion([user.id])
|
|
});
|
|
}
|
|
}
|