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

[IMPROVE] Replace livechat:externalMessages publication by REST #15643

Merged
merged 5 commits into from
Nov 13, 2019

Conversation

MarcosSpessatto
Copy link
Member

No description provided.

this.roomId = Template.currentData().rid;
this.subscribe('livechat:externalMessages', Template.currentData().rid);
if (this.roomId) {
const { messages } = await APIClient.v1.get(`livechat/messages.external?roomId=${ this.roomId }`);

Choose a reason for hiding this comment

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

We need to use pagination here, otherwise, only the first fetch will be displayed.


export class LivechatExternalMessage extends Base {
constructor() {
super('livechat_external_message');

Choose a reason for hiding this comment

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

What about creating an index for the rid field?
It would provide more performance when finding records.

@renatobecker-zz renatobecker-zz merged commit b51d9f7 into develop Nov 13, 2019
@renatobecker-zz renatobecker-zz deleted the replace-livechat-external-messages-pub branch November 13, 2019 20:36
tassoevan pushed a commit that referenced this pull request Nov 13, 2019
* Regression messageAttachments

* [IMPROVE] Replace livechat:externalMessages publication by REST (#15643)

* Replace livechat:externalMessages publication by REST

* Fix lint

* Add pagination to livechat external messages

* Add index and remove obsolete collection

* remove pages to dynamic
@sampaiodiego sampaiodiego mentioned this pull request Nov 28, 2019
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.

2 participants