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

Commit bca11cf

Browse files
committed
Merge pull request #174 from CoderDojo/ckiss-fixes
added parent whitelist fields
2 parents 0e92e9f + 1c79975 commit bca11cf

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

profiles.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,24 @@ module.exports = function (options) {
5555
'optionalHiddenFields'
5656
];
5757

58+
var parentGuardianPublicFields = [
59+
'name',
60+
'languagesSpoken',
61+
'programmingLanguages',
62+
'linkedin',
63+
'twitter',
64+
'userTypes',
65+
'dojos',
66+
'badges',
67+
'optionalHiddenFields',
68+
'children' // this will be removed at a later stage
69+
];
70+
5871
var fieldWhiteList = {
5972
'mentor': mentorPublicFields,
6073
'champion': championPublicFields,
61-
'attendee-o13': attendeeO13PublicFields
74+
'attendee-o13': attendeeO13PublicFields,
75+
'parent-guardian': parentGuardianPublicFields
6276
};
6377

6478
// var allowedOptionalFieldsYouth = ['dojos', 'linkedin', 'twitter', 'badges'];
@@ -604,6 +618,7 @@ module.exports = function (options) {
604618
return done(err);
605619
}
606620

621+
_.omit(profile, 'children');
607622
profile.resolvedChildren = resolvedChildren;
608623

609624
return done(null, profile);

0 commit comments

Comments
 (0)