2019-10-27 13:31:59 +00:00
|
|
|
/* global axios */
|
|
|
|
import ApiClient from '../ApiClient';
|
|
|
|
|
|
|
|
class FBChannel extends ApiClient {
|
|
|
|
constructor() {
|
|
|
|
super('facebook_indicators');
|
|
|
|
}
|
|
|
|
|
|
|
|
markSeen({ inboxId, contactId }) {
|
|
|
|
return axios.post(`${this.url}/mark_seen`, {
|
|
|
|
inbox_id: inboxId,
|
|
|
|
contact_id: contactId,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
toggleTyping({ status, inboxId, contactId }) {
|
|
|
|
return axios.post(`${this.url}/typing_${status}`, {
|
|
|
|
inbox_id: inboxId,
|
|
|
|
contact_id: contactId,
|
|
|
|
});
|
|
|
|
}
|
2019-12-28 16:26:42 +00:00
|
|
|
|
|
|
|
create(params) {
|
|
|
|
return axios.post(
|
|
|
|
`${this.apiVersion}/callbacks/register_facebook_page`,
|
|
|
|
params
|
|
|
|
);
|
|
|
|
}
|
2019-10-27 13:31:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default new FBChannel();
|