Chatwoot/app/javascript/dashboard/api/inbox/conversation.js
Pranav Raj S 0740d4762f
Enhancement: Paginate conversation calls in tabs (#560)
* Use conversationPage module for pagination

* Load more conversations

* Reset list if conversation status is changed

* Add specs to conversationPage

* Reset filter when page is re-mounted

* Update text

* Update text
2020-02-26 21:15:01 +05:30

38 lines
822 B
JavaScript

/* global axios */
import ApiClient from '../ApiClient';
class ConversationApi extends ApiClient {
constructor() {
super('conversations');
}
get({ inboxId, status, assigneeType, page }) {
return axios.get(this.url, {
params: {
inbox_id: inboxId,
status,
assignee_type: assigneeType,
page,
},
});
}
toggleStatus(conversationId) {
return axios.post(`${this.url}/${conversationId}/toggle_status`, {});
}
assignAgent({ conversationId, agentId }) {
axios.post(
`${this.url}/${conversationId}/assignments?assignee_id=${agentId}`,
{}
);
}
markMessageRead({ id, lastSeen }) {
return axios.post(`${this.url}/${id}/update_last_seen`, {
agent_last_seen_at: lastSeen,
});
}
}
export default new ConversationApi();