Enable column edition, and fix ordering (#683)
* Enable column edition, and fix ordering * Move queries to services * Add total amounts for board columns * Refactor totals selector as a family * Fix 0-index issue * Lint * Rename selector * Remove useless header * Address PR comments * Optimistically update board column names
This commit is contained in:
76
front/src/modules/companies/queries/update.ts
Normal file
76
front/src/modules/companies/queries/update.ts
Normal file
@ -0,0 +1,76 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const UPDATE_COMPANY = gql`
|
||||
mutation UpdateCompany(
|
||||
$id: String
|
||||
$name: String
|
||||
$domainName: String
|
||||
$accountOwnerId: String
|
||||
$createdAt: DateTime
|
||||
$address: String
|
||||
$employees: Int
|
||||
) {
|
||||
updateOneCompany(
|
||||
where: { id: $id }
|
||||
data: {
|
||||
accountOwner: { connect: { id: $accountOwnerId } }
|
||||
address: { set: $address }
|
||||
domainName: { set: $domainName }
|
||||
employees: { set: $employees }
|
||||
name: { set: $name }
|
||||
createdAt: { set: $createdAt }
|
||||
}
|
||||
) {
|
||||
accountOwner {
|
||||
id
|
||||
email
|
||||
displayName
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
address
|
||||
createdAt
|
||||
domainName
|
||||
employees
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_COMPANY = gql`
|
||||
mutation InsertCompany(
|
||||
$id: String!
|
||||
$name: String!
|
||||
$domainName: String!
|
||||
$createdAt: DateTime
|
||||
$address: String!
|
||||
$employees: Int
|
||||
) {
|
||||
createOneCompany(
|
||||
data: {
|
||||
id: $id
|
||||
name: $name
|
||||
domainName: $domainName
|
||||
createdAt: $createdAt
|
||||
address: $address
|
||||
employees: $employees
|
||||
}
|
||||
) {
|
||||
address
|
||||
createdAt
|
||||
domainName
|
||||
employees
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_COMPANIES = gql`
|
||||
mutation DeleteCompanies($ids: [String!]) {
|
||||
deleteManyCompany(where: { id: { in: $ids } }) {
|
||||
count
|
||||
}
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user