Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 0d5b688

Browse files
committed
Better rewrite those functions whose behavior are 80% the same
1 parent 6e1314e commit 0d5b688

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

profiles.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ module.exports = function (options) {
165165
email: profile.email,
166166
initUserType: {name: initUserType},
167167
password: password,
168+
mailingList: profile.user ? profile.user.mailingList : 0,
168169
roles: ['basic-user']
169170
};
170171

@@ -259,8 +260,10 @@ module.exports = function (options) {
259260
});
260261
}
261262

263+
// Note : tbdeleted
262264
function saveChild (profile, parentId, done) {
263265
if (_.contains(profile.parents, parentId)) {
266+
delete profile.user;
264267
seneca.make$(ENTITY_NS).save$(profile, function (err, profile) {
265268
if (err) {
266269
return done(err);

0 commit comments

Comments
 (0)