refactor: move person types in interface
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
import { Company } from '../../interfaces/company.interface';
|
import { Company } from './company.interface';
|
||||||
import { Pipe } from '../../interfaces/pipe.interface';
|
import { Pipe } from './pipe.interface';
|
||||||
|
|
||||||
export type Person = {
|
export type Person = {
|
||||||
fullName: string;
|
fullName: string;
|
||||||
@ -4,7 +4,7 @@ import Table from '../../components/table/Table';
|
|||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import { peopleColumns } from './people-table';
|
import { peopleColumns } from './people-table';
|
||||||
import { gql, useQuery } from '@apollo/client';
|
import { gql, useQuery } from '@apollo/client';
|
||||||
import { GraphqlPerson, Person } from './types';
|
import { GraphqlPerson, Person } from '../../interfaces/person.interface';
|
||||||
import { defaultData } from './default-data';
|
import { defaultData } from './default-data';
|
||||||
import { mapPerson } from './mapper';
|
import { mapPerson } from './mapper';
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Person } from './types';
|
import { Person } from '../../interfaces/person.interface';
|
||||||
|
|
||||||
export const defaultData: Array<Person> = [
|
export const defaultData: Array<Person> = [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { GraphqlPerson, Person } from './types';
|
import { GraphqlPerson, Person } from '../../interfaces/person.interface';
|
||||||
|
|
||||||
export const mapPerson = (person: GraphqlPerson): Person => ({
|
export const mapPerson = (person: GraphqlPerson): Person => ({
|
||||||
fullName: `${person.firstname} ${person.lastname}`,
|
fullName: `${person.firstname} ${person.lastname}`,
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import Checkbox from '../../components/form/Checkbox';
|
|||||||
import HorizontalyAlignedContainer from '../../layout/containers/HorizontalyAlignedContainer';
|
import HorizontalyAlignedContainer from '../../layout/containers/HorizontalyAlignedContainer';
|
||||||
import CompanyChip from '../../components/chips/CompanyChip';
|
import CompanyChip from '../../components/chips/CompanyChip';
|
||||||
import PersonChip from '../../components/chips/PersonChip';
|
import PersonChip from '../../components/chips/PersonChip';
|
||||||
import { Person } from './types';
|
import { Person } from '../../interfaces/person.interface';
|
||||||
|
|
||||||
const columnHelper = createColumnHelper<Person>();
|
const columnHelper = createColumnHelper<Person>();
|
||||||
export const peopleColumns = [
|
export const peopleColumns = [
|
||||||
|
|||||||
Reference in New Issue
Block a user