Added vehicle search function + paginated vehicles page BOD-116

This commit is contained in:
Patrick Fic
2020-07-13 15:50:07 -07:00
parent 934dc1f647
commit d5026133e0
12 changed files with 215 additions and 28 deletions

View File

@@ -71,6 +71,38 @@ export const QUERY_ALL_VEHICLES = gql`
}
`;
export const QUERY_ALL_VEHICLES_PAGINATED = gql`
query QUERY_ALL_VEHICLES(
$search: String
$offset: Int
$limit: Int
$order: [vehicles_order_by!]!
) {
search_vehicles(
args: { search: $search }
offset: $offset
limit: $limit
order_by: $order
) {
id
plate_no
plate_st
v_vin
v_model_yr
v_model_desc
v_make_desc
v_color
v_bstyle
updated_at
}
search_vehicles_aggregate(args: { search: $search }) {
aggregate {
count(distinct: true)
}
}
}
`;
export const SEARCH_VEHICLE_BY_VIN = gql`
query SEARCH_VEHICLE_BY_VIN($vin: String!) {
vehicles(where: { v_vin: { _ilike: $vin } }) {