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/server/api/v1/transcript.js

26 lines
676 B

import { check } from 'meteor/check';
import { TAPi18n } from 'meteor/rocketchat:tap-i18n';
import { API } from '../../../../api/server';
import { Livechat } from '../../lib/Livechat';
API.v1.addRoute('livechat/transcript', {
post() {
try {
check(this.bodyParams, {
token: String,
rid: String,
email: String,
});
const { token, rid, email } = this.bodyParams;
if (!Livechat.sendTranscript({ token, rid, email })) {
return API.v1.failure({ message: TAPi18n.__('Error_sending_livechat_transcript') });
}
return API.v1.success({ message: TAPi18n.__('Livechat_transcript_sent') });
} catch (e) {
return API.v1.failure(e);
}
},
});