File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
lansweeper/aws/integration-lambda Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ class LansweeperClient {
132
132
return [ firstPage ] ;
133
133
}
134
134
135
- let total = firstPage . total ;
135
+ const total = firstPage . total ;
136
136
if ( firstPage . items ) {
137
137
retrieved += firstPage . items . length ;
138
138
console . log ( `retrieved first ${ retrieved } of ${ total } ` ) ;
@@ -149,7 +149,6 @@ class LansweeperClient {
149
149
break ;
150
150
}
151
151
152
- total = nextPage . total ;
153
152
if ( nextPage . items && nextPage . items . length > 0 ) {
154
153
retrieved += nextPage . items . length ;
155
154
console . log ( `retrieved first ${ retrieved } of ${ total } ` ) ;
@@ -208,10 +207,11 @@ class LansweeperClient {
208
207
. split ( ' ' )
209
208
. forEach ( field => fields . push ( `processors.${ field } ` ) ) ;
210
209
210
+ const totalField = pagination . page === 'FIRST' ? 'total' : '' ;
211
211
const query = `query getAssetResources($siteId: ID!, $pagination: AssetsPaginationInputValidated, $fields: [String!]!) {
212
212
site(id: $siteId) {
213
213
assetResources(assetPagination: $pagination, fields: $fields, filters: ${ filters } ) {
214
- total
214
+ ${ totalField }
215
215
pagination {
216
216
next
217
217
}
You can’t perform that action at this time.
0 commit comments