IO-868 IO-706 Unique vendor & employee names.

This commit is contained in:
Patrick Fic
2021-04-09 11:03:40 -07:00
parent bb83894e37
commit 136541b291
13 changed files with 334 additions and 2 deletions

View File

@@ -18,6 +18,21 @@ export const QUERY_EMPLOYEES = gql`
}
`;
export const CHECK_EMPLOYEE_NUMBER = gql`
query CHECK_EMPLOYEE_NUMBER($employeenumber: String!) {
employees_aggregate(
where: { employee_number: { _ilike: $employeenumber } }
) {
aggregate {
count
}
nodes {
id
}
}
}
`;
export const QUERY_ACTIVE_EMPLOYEES = gql`
query QUERY_ACTIVE_EMPLOYEES {
employees(where: { active: { _eq: true } }) {

View File

@@ -21,6 +21,18 @@ export const QUERY_VENDOR_BY_ID = gql`
}
}
`;
export const CHECK_VENDOR_NAME = gql`
query CHECK_VENDOR_NAME($name: String!) {
vendors_aggregate(where: { name: { _ilike: $name } }) {
aggregate {
count
}
nodes {
id
}
}
}
`;
export const UPDATE_VENDOR = gql`
mutation UPDATE_VENDOR($id: uuid!, $vendor: vendors_set_input!) {