Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
B77Mills committed Sep 27, 2023
1 parent 084d485 commit a1029f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/marko-web-identity-x/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class IdentityXConfiguration {
hiddenFields = ['city', 'street', 'addressExtra', 'phoneNumber'],
defaultCountryCode,
booleanQuestionsLabel,
gtmUserFields = {}, // { primary_role: 'ObjectId' }
gtmUserFields = {},
onHookError,
...rest
} = {}) {
Expand Down Expand Up @@ -115,9 +115,9 @@ class IdentityXConfiguration {
const questions = this.getAsObject('gtmUserFields');
const userData = { user_id: user.id };
Object.entries(questions).forEach(([key, value]) => {
const select = user.customSelectFieldAnswers.find(({ id }) => id === value)
if (select && select.answers.length) userData[key] = select.answers.map(({ label }) => label).join("|");
const boolean = user.customBooleanFieldAnswers.find(({ id }) => id === value)
const select = user.customSelectFieldAnswers.find(({ id }) => id === value);
if (select && select.answers.length) userData[key] = select.answers.map(({ label }) => label).join('|');
const boolean = user.customBooleanFieldAnswers.find(({ id }) => id === value);
if (boolean && boolean.hasAnswered) userData[key] = boolean.answer;
});
return userData;
Expand Down

0 comments on commit a1029f0

Please sign in to comment.