The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Rocket.Chat/app/livechat/imports/server/rest/messages.js

26 lines
594 B

import { check } from 'meteor/check';
import { API } from '../../../../api';
import { findExternalMessages } from '../../../server/api/lib/messages';
API.v1.addRoute('livechat/messages.external/:roomId', { authRequired: true }, {
get() {
check(this.urlParams, {
roomId: String,
});
const { offset, count } = this.getPaginationItems();
const { sort } = this.parseJsonQuery();
const departments = Promise.await(findExternalMessages({
roomId: this.urlParams.roomId,
pagination: {
offset,
count,
sort,
},
}));
return API.v1.success(departments);
},
});