Update FE case to match BE graphql case (camelCase) (#154)
This commit is contained in:
@@ -6,13 +6,13 @@ describe('reduceSortsToOrderBy', () => {
|
||||
const sorts = [
|
||||
{ key: 'name', label: 'name', order: 'asc', _type: 'default_sort' },
|
||||
{
|
||||
key: 'domain_name',
|
||||
label: 'domain_name',
|
||||
key: 'domainName',
|
||||
label: 'domainName',
|
||||
order: 'desc',
|
||||
_type: 'default_sort',
|
||||
},
|
||||
] satisfies CompaniesSelectedSortType[];
|
||||
const result = reduceSortsToOrderBy(sorts);
|
||||
expect(result).toEqual([{ name: 'asc' }, { domain_name: 'desc' }]);
|
||||
expect(result).toEqual([{ name: 'asc' }, { domainName: 'desc' }]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -16,12 +16,12 @@ export const GET_COMPANIES = gql`
|
||||
) {
|
||||
companies(orderBy: $orderBy, where: $where) {
|
||||
id
|
||||
domain_name: domainName
|
||||
domainName
|
||||
name
|
||||
created_at: createdAt
|
||||
createdAt
|
||||
address
|
||||
employees
|
||||
account_owner: accountOwner {
|
||||
accountOwner {
|
||||
id
|
||||
email
|
||||
displayName
|
||||
|
||||
@@ -9,31 +9,31 @@ export const UPDATE_COMPANY = gql`
|
||||
mutation UpdateCompany(
|
||||
$id: String
|
||||
$name: String
|
||||
$domain_name: String
|
||||
$account_owner_id: String
|
||||
$created_at: DateTime
|
||||
$domainName: String
|
||||
$accountOwnerId: String
|
||||
$createdAt: DateTime
|
||||
$address: String
|
||||
$employees: Int
|
||||
) {
|
||||
updateOneCompany(
|
||||
where: { id: $id }
|
||||
data: {
|
||||
accountOwner: { connect: { id: $account_owner_id } }
|
||||
accountOwner: { connect: { id: $accountOwnerId } }
|
||||
address: { set: $address }
|
||||
domainName: { set: $domain_name }
|
||||
domainName: { set: $domainName }
|
||||
employees: { set: $employees }
|
||||
name: { set: $name }
|
||||
createdAt: { set: $created_at }
|
||||
createdAt: { set: $createdAt }
|
||||
}
|
||||
) {
|
||||
accountOwner {
|
||||
id
|
||||
email
|
||||
display_name: displayName
|
||||
displayName
|
||||
}
|
||||
address
|
||||
created_at: createdAt
|
||||
domain_name: domainName
|
||||
createdAt
|
||||
domainName
|
||||
employees
|
||||
id
|
||||
name
|
||||
@@ -45,8 +45,8 @@ export const INSERT_COMPANY = gql`
|
||||
mutation InsertCompany(
|
||||
$id: String!
|
||||
$name: String!
|
||||
$domain_name: String!
|
||||
$created_at: DateTime
|
||||
$domainName: String!
|
||||
$createdAt: DateTime
|
||||
$address: String!
|
||||
$employees: Int
|
||||
) {
|
||||
@@ -54,15 +54,15 @@ export const INSERT_COMPANY = gql`
|
||||
data: {
|
||||
id: $id
|
||||
name: $name
|
||||
domainName: $domain_name
|
||||
createdAt: $created_at
|
||||
domainName: $domainName
|
||||
createdAt: $createdAt
|
||||
address: $address
|
||||
employees: $employees
|
||||
}
|
||||
) {
|
||||
address
|
||||
created_at: createdAt
|
||||
domain_name: domainName
|
||||
createdAt
|
||||
domainName
|
||||
employees
|
||||
id
|
||||
name
|
||||
|
||||
@@ -41,7 +41,7 @@ it('updates a person', async () => {
|
||||
icon: '!',
|
||||
},
|
||||
],
|
||||
creationDate: new Date(),
|
||||
createdAt: new Date(),
|
||||
city: 'San Francisco',
|
||||
__typename: 'people',
|
||||
});
|
||||
|
||||
@@ -22,11 +22,11 @@ export const GET_PEOPLE = gql`
|
||||
city
|
||||
firstname
|
||||
lastname
|
||||
created_at: createdAt
|
||||
createdAt
|
||||
company {
|
||||
id
|
||||
name
|
||||
domain_name: domainName
|
||||
domainName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,26 +12,26 @@ export const UPDATE_PERSON = gql`
|
||||
$lastname: String
|
||||
$phone: String
|
||||
$city: String
|
||||
$company_id: String
|
||||
$companyId: String
|
||||
$email: String
|
||||
$created_at: DateTime
|
||||
$createdAt: DateTime
|
||||
) {
|
||||
updateOnePerson(
|
||||
where: { id: $id }
|
||||
data: {
|
||||
city: { set: $city }
|
||||
company: { connect: { id: $company_id } }
|
||||
company: { connect: { id: $companyId } }
|
||||
email: { set: $email }
|
||||
firstname: { set: $firstname }
|
||||
id: { set: $id }
|
||||
lastname: { set: $lastname }
|
||||
phone: { set: $phone }
|
||||
createdAt: { set: $created_at }
|
||||
createdAt: { set: $createdAt }
|
||||
}
|
||||
) {
|
||||
city
|
||||
company {
|
||||
domain_name: domainName
|
||||
domainName
|
||||
name
|
||||
id
|
||||
}
|
||||
@@ -40,7 +40,7 @@ export const UPDATE_PERSON = gql`
|
||||
id
|
||||
lastname
|
||||
phone
|
||||
created_at: createdAt
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -53,7 +53,7 @@ export const INSERT_PERSON = gql`
|
||||
$phone: String!
|
||||
$city: String!
|
||||
$email: String!
|
||||
$created_at: DateTime
|
||||
$createdAt: DateTime
|
||||
) {
|
||||
createOnePerson(
|
||||
data: {
|
||||
@@ -63,12 +63,12 @@ export const INSERT_PERSON = gql`
|
||||
phone: $phone
|
||||
city: $city
|
||||
email: $email
|
||||
createdAt: $created_at
|
||||
createdAt: $createdAt
|
||||
}
|
||||
) {
|
||||
city
|
||||
company {
|
||||
domain_name: domainName
|
||||
domainName
|
||||
name
|
||||
id
|
||||
}
|
||||
@@ -77,7 +77,7 @@ export const INSERT_PERSON = gql`
|
||||
id
|
||||
lastname
|
||||
phone
|
||||
created_at: createdAt
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -44,7 +44,7 @@ export const SEARCH_COMPANY_QUERY = gql`
|
||||
searchResults: companies(where: $where, take: $limit) {
|
||||
id
|
||||
name
|
||||
domain_name: domainName
|
||||
domainName
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -7,11 +7,11 @@ export const GET_CURRENT_USER = gql`
|
||||
id
|
||||
email
|
||||
displayName
|
||||
workspace_member: WorkspaceMember {
|
||||
workspaceMember: WorkspaceMember {
|
||||
workspace {
|
||||
id
|
||||
domain_name: domainName
|
||||
display_name: displayName
|
||||
domainName
|
||||
displayName
|
||||
logo
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user