Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW] Integrations, both incoming and outgoing, now have access to the models. Example: Users.findOneById(id) #6420

Merged
merged 4 commits into from
Mar 23, 2017

Conversation

graywolf336
Copy link
Contributor

@RocketChat/core

Closes #6336

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-6420 March 22, 2017 14:20 Inactive
@sampaiodiego
Copy link
Member

sampaiodiego commented Mar 22, 2017

I can see integrations being broke because the way we change model's functions (without any kind of control or versioning)

@graywolf336
Copy link
Contributor Author

I think we need to list those changes inside of the HISTORY now, @sampaiodiego

@rodrigok
Copy link
Member

@graywolf336 can you fix the conflict?

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-6420 March 23, 2017 17:02 Inactive
@graywolf336
Copy link
Contributor Author

@rodrigok Done

@engelgabriel engelgabriel modified the milestone: 0.55.0 Mar 23, 2017
@rodrigok rodrigok modified the milestone: 0.55.0 Mar 23, 2017
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-6420 March 23, 2017 20:30 Inactive
@rodrigok rodrigok merged commit a2c853c into develop Mar 23, 2017
@rodrigok rodrigok deleted the rocket-models-in-webhooks branch March 23, 2017 21:08
@mykiep
Copy link

mykiep commented Jan 25, 2018

Are there any examples on how to access the models with outgoing and incoming webhooks? I'm trying to use this in liue of having to make rest calls to the APIs inside of web hooks. I've tried a couple ways with no luck.

@graywolf336
Copy link
Contributor Author

@mykiep you can use any of the models and their methods found at (except for the ones starting with an underscore: https://github.com/RocketChat/Rocket.Chat/tree/develop/packages/rocketchat-lib/server/models

Thus to find a user you could do Users.findOneById(userId) to get the user's record in the database or Rooms.findOneById(roomId to get a room's record in the database.

@rodrigok rodrigok changed the title Rocket models in webhooks [NEW] Integrations, both incoming and outgoing, now have access to the models. Example: Users.findOneById(id) Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Q] How to access to models from outgoing webhook integration?
5 participants