refactor: move mapper in interface
This commit is contained in:
@ -28,3 +28,16 @@ export type GraphqlPerson = {
|
||||
phone: string;
|
||||
__typename: string;
|
||||
};
|
||||
|
||||
export const mapPerson = (person: GraphqlPerson): Person => ({
|
||||
fullName: `${person.firstname} ${person.lastname}`,
|
||||
creationDate: new Date(person.created_at),
|
||||
pipe: { name: 'coucou', id: 1, icon: 'faUser' },
|
||||
...person,
|
||||
company: {
|
||||
id: 1,
|
||||
name: person.company.company_name,
|
||||
domain: person.company.company_domain,
|
||||
},
|
||||
countryCode: 'FR',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user