Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
merge issue fix, duplicated function removed
Browse files Browse the repository at this point in the history
  • Loading branch information
cianfoley-nearform committed Apr 12, 2018
1 parent d439333 commit 53d09f0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 40 deletions.
2 changes: 1 addition & 1 deletion docs/swagger/swagger.json

Large diffs are not rendered by default.

39 changes: 0 additions & 39 deletions packages/udaru-core/lib/ops/organizationOps.js
Original file line number Diff line number Diff line change
Expand Up @@ -700,45 +700,6 @@ function buildOrganizationOps (db, config) {
return promise
},

/**
* List an organizations policies
*
* @param {Object} params { id, organizationId, limit, page }
* @param {Function} cb
*/
listOrganizationPolicies: function listOrganizationPolicies ({ id, organizationId, page = 1, limit }, cb) {
let promise = null
if (typeof cb !== 'function') [promise, cb] = asyncify()

Joi.validate({ id, organizationId, page, limit }, validationRules.listOrganizationPolicies, function (err) {
if (err) return cb(Boom.badRequest(err))

const offset = (page - 1) * limit
const job = {
id,
organizationId,
offset,
limit,
organization: {},
client: db
}

loadOrganizationPolicies(job, (err) => {
if (err) return cb(err)
const pageSize = limit || job.totalPoliciesCount
const result = {
page: page,
limit: pageSize,
total: job.totalPoliciesCount,
data: job.organization.policies
}
return cb(null, result)
})
})

return promise
},

/**
* List an organizations policies
*
Expand Down

0 comments on commit 53d09f0

Please sign in to comment.