Skip to content

Commit

Permalink
Dev/oddk/frontend redesign (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpolidori authored Aug 7, 2023
1 parent 6941bee commit cf7cd33
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions lib/dms.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,30 @@ class DmsModel {
return response.result.results
}

async getAllPackages(context) {
const action = 'package_search'
const params = {
rows: 1000,
start: 0
}

const response = await this.getJsonResponse(params, action)
const packages = response.result.results
const total = response.result.count
const limit = 1000
const offset = 1000
const pages = Math.ceil(total / limit)

let allPackages = packages

for (let i = 1; i < pages; i++) {
const response = await this.getJsonResponse({rows: limit, start: offset * i}, action)
allPackages = allPackages.concat(response.result.results)
}

return allPackages
}

async getPackage(name, includeViewsAndSchema = true) {
const action = 'package_show'
const params = {
Expand Down

0 comments on commit cf7cd33

Please sign in to comment.