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

fix: allow empty results when the user is in no teams #454

Merged
merged 1 commit into from
Feb 15, 2018

Conversation

mihaidma
Copy link
Contributor

@mihaidma mihaidma commented Feb 6, 2018

Addresses #453

This unifies the implementation with the ones made at similar endpoints, like get users:

  • the page is what the user sends or 1 by default
  • the limit is what the user sends or 100 by default (100 is set in config)
  • the answer is an object containing: page used for query, limit used for query, the total records found (not only the returned ones), the data result of the current query

There seems to be some implementation on Get team users that is not consistent with the other endpoints, will open an issue to investigate it.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 96.277% when pulling 7b78c59 on fix/get-teams into 79b04de on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 96.277% when pulling 7b78c59 on fix/get-teams into 79b04de on master.

@floridemai floridemai self-assigned this Feb 13, 2018
Copy link
Contributor

@floridemai floridemai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good. only one comment that you can address ;)

@@ -312,10 +312,11 @@ exports.register = function (server, options, next) {
handler: function (request, reply) {
const { id } = request.params
const { organizationId } = request.udaru
const { limit, page } = request.query
const limit = request.query.limit || server.udaruConfig.get('authorization.defaultPageSize')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be done with Joi.default()? => reusable validation and no extra code needed in the handler 👍

@mihaidma mihaidma merged commit 0a500ec into master Feb 15, 2018
@mihaidma mihaidma deleted the fix/get-teams branch February 15, 2018 10:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants