Skip to content

Conversation

@matheusbsilva137
Copy link
Contributor

Proposed changes (including videos or screenshots)

  • Add support to queries within the name, username and status parameters.

Issue(s)

Task - ClickUp

Steps to test or reproduce

Example input (using cURL):

curl -G 'http://localhost:3000/api/v1/im.members?roomId=C54E8R3WgShxQ5Tmi&username=some.user&status[]=online&status[]=away&status[]=busy' \
  -H 'X-Auth-Token: c3rQDH_Fpa7JHSgUrWvlpxwIi1AAu4qTnfAF4SFgWkB' \
  -H 'X-User-Id: dizcH9Edm8hC7ziDX' \
  -H 'Content-Type: application/json'

Further comments

throw new Meteor.Error('error-status-param-not-an-array', 'The parameter "status" should be an array of strings');
}

const cursor = Subscriptions.findByRoomId(findResult.room._id, {
Copy link
Member

Choose a reason for hiding this comment

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

Add a projection to fetch only the u prop, since you're not using the rest of the result

@matheusbsilva137
Copy link
Contributor Author

@KevLehman , regarding the addition of support to regex in the im.members endpoint, some changes would need to be applied in the findOneByIdOrName method. Since this method is used in many places, I think this could bring some unexpected behaviors 🤔 (or maybe this would be a breaking change), wdyt?

@sampaiodiego sampaiodiego merged commit f538255 into develop May 14, 2021
@sampaiodiego sampaiodiego deleted the query-im-members branch May 14, 2021 13:43
@sampaiodiego sampaiodiego mentioned this pull request May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants