Created
July 6, 2020 13:57
-
-
Save MartinMalinda/a6f2a4893c593cf5aefd1ed6a505fb70 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
export function normalizeFindUsersResponse(response) { | |
return response.data.map(normalizeUser); | |
} | |
export function normalizeUser(user) { | |
return { | |
id: user.id, | |
firstName: user.firstName, | |
lastName: user.lastName, | |
createdAt: new Date(user.createdAt), | |
isAdmin: user.admin, | |
image: user.images.main || '/assets/placeholder.png' | |
}; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment