Added status filter to all jobs list IO-581

This commit is contained in:
Patrick Fic
2021-02-02 17:22:45 -08:00
parent 0bbfb259c0
commit 8a031d3309
3 changed files with 64 additions and 35 deletions

View File

@@ -1126,18 +1126,20 @@ export const QUERY_JOBS_IN_PRODUCTION = gql`
}
`;
export const QUERY_ALL_JOBS_PAGINATED = gql`
query QUERY_ALL_JOBS_PAGINATED(
export const QUERY_ALL_JOBS_PAGINATED_STATUS_FILTERED = gql`
query QUERY_ALL_JOBS_PAGINATED_STATUS_FILTERED(
$search: String
$offset: Int
$limit: Int
$order: [jobs_order_by!]
$statusList: [String!]
) {
search_jobs(
args: { search: $search }
offset: $offset
limit: $limit
order_by: $order
where: { status: { _in: $statusList } }
) {
ownr_fn
ownr_ln
@@ -1154,7 +1156,6 @@ export const QUERY_ALL_JOBS_PAGINATED = gql`
actual_completion
actual_delivery
actual_in
id
ins_co_nm
ins_ct_fn
@@ -1178,7 +1179,10 @@ export const QUERY_ALL_JOBS_PAGINATED = gql`
ded_amt
vehicleid
}
search_jobs_aggregate(args: { search: $search }) {
search_jobs_aggregate(
args: { search: $search }
where: { status: { _in: $statusList } }
) {
aggregate {
count(distinct: true)
}