refactor: extract mapper
This commit is contained in:
14
front/src/pages/people/mapper.ts
Normal file
14
front/src/pages/people/mapper.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { GraphqlPerson, Person } from './types';
|
||||
|
||||
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