Add seeds and move to uuid (#80)

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Charles Bochet
2023-04-26 16:42:01 +02:00
committed by GitHub
parent 5aec7ca730
commit 6c7eb53333
38 changed files with 523 additions and 5935 deletions

View File

@ -24,16 +24,16 @@ jest.mock('../../../apollo', () => {
it('updates a person', async () => {
const result = await updatePerson({
fullName: 'John Doe',
id: 1,
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6c',
email: 'john@example.com',
company: {
id: 2,
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
name: 'ACME',
domain: 'example.com',
domain_name: 'example.com',
},
phone: '+1 (555) 123-4567',
pipe: {
id: 3,
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6d',
name: 'Customer',
icon: '!',
},

View File

@ -21,7 +21,7 @@ export const reduceSortsToOrderBy = (
acc['firstname'] = order;
acc['lastname'] = order;
} else if (id === 'company_name') {
acc['company'] = { company_name: order };
acc['company'] = { name: order };
} else {
acc[id] = order;
}
@ -42,8 +42,8 @@ export const GET_PEOPLE = gql`
created_at
company {
id
company_name
company_domain
name
domain_name
}
}
}

View File

@ -4,12 +4,12 @@ import { apiClient } from '../../apollo';
export const UPDATE_PERSON = gql`
mutation UpdatePeople(
$id: Int
$id: uuid
$firstname: String
$lastname: String
$phone: String
$city: String
$company_id: Int
$company_id: uuid
$email: String
) {
update_people(
@ -27,8 +27,8 @@ export const UPDATE_PERSON = gql`
returning {
city
company {
company_domain
company_name
domain_name
name
id
}
email