File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
packages/orchestrator-ui-components/src/rtk/endpoints Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change
1
+ import { NUMBER_OF_ITEMS_REPRESENTING_ALL_ITEMS } from '@/configuration' ;
1
2
import {
2
3
Customer ,
3
4
CustomerWithSubscriptionCount ,
4
5
CustomersResult ,
5
6
CustomersWithSubscriptionCountResult ,
7
+ SubscriptionStatus ,
6
8
} from '@/types' ;
7
9
8
10
import { orchestratorApi } from '../api' ;
@@ -18,12 +20,12 @@ const customersQuery = `query Customers {
18
20
}` ;
19
21
20
22
const customersWithSubscriptionCountQuery = `query Customers {
21
- customers(first: 1000000 , after: 0) {
23
+ customers(first: ${ NUMBER_OF_ITEMS_REPRESENTING_ALL_ITEMS } , after: 0) {
22
24
page {
23
25
customerId
24
26
fullname
25
27
shortcode
26
- subscriptions(filterBy: {field: "status", value: "ACTIVE"}) {
28
+ subscriptions(filterBy: {field: "status", value: "${ SubscriptionStatus . ACTIVE } "}) {
27
29
pageInfo {
28
30
totalItems
29
31
}
@@ -59,7 +61,8 @@ const customersApi = orchestratorApi.injectEndpoints({
59
61
response : CustomersWithSubscriptionCountResult ,
60
62
) : CustomerWithSubscriptionCount [ ] =>
61
63
response . customers . page . filter (
62
- ( c ) => c . subscriptions . pageInfo . totalItems > 0 ,
64
+ ( customer ) =>
65
+ customer . subscriptions . pageInfo . totalItems > 0 ,
63
66
) ,
64
67
} ) ,
65
68
getCustomers : build . query < Customer [ ] , void > ( {
You can’t perform that action at this time.
0 commit comments