We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2b1eca commit 8d4f223Copy full SHA for 8d4f223
functions/index.js
@@ -27,4 +27,20 @@ exports.projectCreated =
27
}
28
29
return createNotification(notification);
30
+});
31
+
32
+exports.userJoined = functions.auth.user().onCreate(user => {
33
34
+ return admin.firestore().collection('users')
35
+ .doc(user.uid).get().then(doc => {
36
37
+ const newUser = doc.data();
38
+ const notification = {
39
+ content: 'Joined the WorkPlace!',
40
+ user: `${newUser.firstName} ${newUser.lastName}`,
41
+ time: admin.firestore.FieldValue.serverTimestamp()
42
+ }
43
44
+ return createNotification(notification);
45
+ })
46
})
0 commit comments