-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] User email showing [object Object] (#19870)
- Loading branch information
1 parent
3b9f915
commit 8a0258f
Showing
3 changed files
with
13 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import type { IUser, IUserEmail } from '../../definition/IUser'; | ||
import type { IUser } from '../../definition/IUser'; | ||
|
||
export const getUserEmailAddress = (user: IUser): IUserEmail | undefined => | ||
(Array.isArray(user.emails) ? user.emails.find(({ address }) => !!address) : undefined); | ||
export const getUserEmailAddress = (user: IUser): string | undefined => | ||
(Array.isArray(user.emails) ? user.emails.find(({ address }) => !!address)?.address : undefined); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import type { IUser } from '../../definition/IUser'; | ||
|
||
export const getUserEmailVerified = (user: IUser): boolean | undefined => | ||
(Array.isArray(user.emails) ? user.emails.find(({ verified }) => !!verified)?.verified : undefined); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters