Added vehicle search function + paginated vehicles page BOD-116
This commit is contained in:
@@ -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 } }) {
|
||||
|
||||
Reference in New Issue
Block a user