Skip to content

Commit

Permalink
[#IOPID-1047] added property to toInitializedProfile utility method (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
arcogabbo authored Dec 18, 2023
1 parent 5b2bcb3 commit c78a64b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/types/__tests__/profile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ describe("profile type", () => {
mockedExtendedProfile.reminder_status
);
expect(userData.version).toBe(mockedExtendedProfile.version);
expect(userData.is_email_already_taken).toBe(
mockedExtendedProfile.is_email_already_taken
);
});

/*test case: Extracts a user profile from the body of a request.*/
Expand Down
1 change: 1 addition & 0 deletions src/types/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const toInitializedProfile = (
family_name: user.family_name,
fiscal_code: user.fiscal_code,
has_profile: true,
is_email_already_taken: profile.is_email_already_taken,
is_email_enabled: pipe(
O.fromNullable(profile.is_email_enabled),
O.getOrElseW(() => true)
Expand Down

0 comments on commit c78a64b

Please sign in to comment.