Skip to content

Conversation

@MarcosSpessatto
Copy link
Contributor

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.

3 participants