Skip to content

Commit 4dd2518

Browse files
author
James Cori
committed
Merge branch 'develop'
2 parents 0dabd0b + 58d2b17 commit 4dd2518

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

docs/swagger.yaml

+13-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ paths:
188188
get:
189189
description: >-
190190
Get all resource roles. If isActive parameter is provided, filter the
191-
results by isActive property.
191+
results by the set properties.
192192
tags:
193193
- Resource Roles
194194
security:
@@ -202,6 +202,18 @@ paths:
202202
type: string
203203
in: query
204204
description: Filters the results based on the `name` property
205+
- name: legacyId
206+
type: number
207+
in: query
208+
description: Filters the results based on the `legacyId` property
209+
- name: selfObtainable
210+
type: boolean
211+
in: query
212+
description: Filters the results based on the `selfObtainable` property
213+
- name: fullAccess
214+
type: boolean
215+
in: query
216+
description: Filters the results based on the `fullAccess` property
205217
responses:
206218
'200':
207219
description: OK - the request was successful

src/services/ResourceRoleService.js

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ async function getResourceRoles (criteria) {
2020
let records = await helper.scan('ResourceRole')
2121
if (criteria.name) records = _.filter(records, e => (criteria.name === e.name))
2222
if (criteria.id) records = _.filter(records, e => (criteria.id === e.id))
23+
if (criteria.legacyId) records = _.filter(records, e => (_.toNumber(criteria.legacyId) === _.toNumber(e.legacyId)))
2324
if (!_.isUndefined(criteria.isActive)) records = _.filter(records, e => (e.isActive === (criteria.isActive === 'true')))
2425
if (!_.isUndefined(criteria.selfObtainable)) records = _.filter(records, e => (e.selfObtainable === (criteria.selfObtainable === 'true')))
2526
if (!_.isUndefined(criteria.fullAccess)) records = _.filter(records, e => (e.fullAccess === (criteria.fullAccess === 'true')))
@@ -33,6 +34,7 @@ getResourceRoles.schema = {
3334
selfObtainable: Joi.boolean(),
3435
fullAccess: Joi.boolean(),
3536
id: Joi.id(),
37+
legacyId: Joi.number(),
3638
name: Joi.string()
3739
}).required()
3840
}

0 commit comments

Comments
 (0)