Skip to content

Commit

Permalink
Merge pull request #928 from adobe/totalfix
Browse files Browse the repository at this point in the history
Totalfix
  • Loading branch information
trieloff authored Jul 28, 2023
2 parents ce6790e + 3503245 commit b2bf28e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ export function sshonify(results, description, requestParams, truncated) {
':version': 3,
results: {
limit: Math.max(requestParams.limit || 1, results.length),
offset: requestParams.offset || 0,
total: requestParams.offset || 0 + results.length + (truncated ? 1 : 0),
offset: parseInt(requestParams.offset, 10) || 0,
total: results.length + Number(truncated),
data: results,
columns: Object.keys(results[0] || {}),
},
Expand Down
8 changes: 4 additions & 4 deletions test/testUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ describe('Test SSHONify', () => {
},
results: {
limit: 30,
offset: '0',
total: '0',
offset: 0,
total: 30,
columns: [
'checkpoint',
'source',
Expand Down Expand Up @@ -520,8 +520,8 @@ describe('Test SSHONify', () => {
},
results: {
limit: 30,
offset: '0',
total: '0',
offset: 0,
total: 0,
columns: [],
data: [],
},
Expand Down

0 comments on commit b2bf28e

Please sign in to comment.