Skip to content

Instantly share code, notes, and snippets.

@MartinMalinda
Created July 6, 2020 13:57
Show Gist options
  • Save MartinMalinda/a6f2a4893c593cf5aefd1ed6a505fb70 to your computer and use it in GitHub Desktop.
Save MartinMalinda/a6f2a4893c593cf5aefd1ed6a505fb70 to your computer and use it in GitHub Desktop.
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