Chatwoot/app/javascript/dashboard/api/inbox/message.js
Pranav Raj S 2a4fb7b056
Bug: Fix conversation not loading from the links in email (#602)
Bug: Load conversation from links
2020-03-08 22:08:25 +05:30

24 lines
544 B
JavaScript

/* eslint no-console: 0 */
/* global axios */
import ApiClient from '../ApiClient';
class MessageApi extends ApiClient {
constructor() {
super('conversations');
}
create({ conversationId, message, private: isPrivate }) {
return axios.post(`${this.url}/${conversationId}/messages`, {
message,
private: isPrivate,
});
}
getPreviousMessages({ conversationId, before }) {
return axios.get(`${this.url}/${conversationId}/messages`, {
params: { before },
});
}
}
export default new MessageApi();