Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update current user's name on Navbar and profile page when address is added. #2455

Merged
merged 10 commits into from
Jun 21, 2017
10 changes: 10 additions & 0 deletions server/methods/accounts/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,20 @@ export function addressBookAdd(address, accountUserId) {
}
}

Meteor.users.upsert(Meteor.userId(), {
$set: {
name: address.fullName
},
$addToSet: {
"profile.addressBook": address
}
});

return Accounts.upsert({
userId: userId
}, {
$set: {
name: address.fullName,
userId: userId
},
$addToSet: {
Expand Down