mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
update map:profilephoto
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -22,6 +22,7 @@ cloud_functions/functions/lib
|
||||
.env.production.local
|
||||
www/.env
|
||||
.env.production
|
||||
.env.development
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
{ "fromField": "lastName", "toField": "lastName" },
|
||||
{ "fromField": "preferredName", "toField": "preferredName" },
|
||||
{ "fromField": "personalBio", "toField": "background" },
|
||||
{ "fromField": "role", "toField": "role" }
|
||||
{ "fromField": "role", "toField": "role" },
|
||||
{ "fromField": "profilePhoto", "toField": "profilePhoto" }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -8,7 +8,7 @@ export const users = functions.firestore
|
||||
const afterData = change.after.data();
|
||||
if (afterData) {
|
||||
if( afterData.founder[0].docPath){
|
||||
const updates = {firstName:afterData.firstName,lastName:afterData.lastName,preferredName:afterData.preferredName,background:afterData.personalBio,role:afterData.role}
|
||||
const updates = {firstName:afterData.firstName,lastName:afterData.lastName,preferredName:afterData.preferredName,background:afterData.personalBio,role:afterData.role,profilePhoto:afterData.profilePhoto}
|
||||
console.log(`updates FROM users/${context.params.id} TO ${afterData.founder[0].docPath}`, updates)
|
||||
await db.doc(afterData.founder[0].docPath).set(updates, { merge: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user