Finish the majority of work on vendors page to add/delete/edit.

This commit is contained in:
Patrick Fic
2020-02-13 16:08:34 -08:00
parent d1b14427cc
commit 206c1e268b
12 changed files with 757 additions and 61 deletions

View File

@@ -24,9 +24,9 @@ export const QUERY_VENDOR_BY_ID = gql`
}
`;
export const UPDATE_VEHICLE = gql`
mutation UPDATE_VEHICLE($vehId: uuid!, $vehicle: vehicles_set_input!) {
update_vehicles(where: { id: { _eq: $vehId } }, _set: $vehicle) {
export const UPDATE_VENDOR = gql`
mutation UPDATE_VENDOR($id: uuid!, $vendor: vendors_set_input!) {
update_vendors(where: { id: { _eq: $id } }, _set: $vendor) {
returning {
id
}
@@ -46,3 +46,23 @@ export const QUERY_ALL_VENDORS = gql`
}
}
`;
export const INSERT_NEW_VENDOR = gql`
mutation INSERT_NEW_VENDOR($vendorInput: [vendors_insert_input!]!) {
insert_vendors(objects: $vendorInput) {
returning {
id
}
}
}
`;
export const DELETE_VENDOR = gql`
mutation DELETE_VENDOR($id: uuid!) {
delete_vendors(where: { id: { _eq: $id } }) {
returning {
id
}
}
}
`;