Re-write live-conversations API

This commit is contained in:
Pranav
2024-02-10 18:41:11 -08:00
parent eb379e1849
commit 375d216d12
8 changed files with 107 additions and 86 deletions
@@ -0,0 +1,20 @@
/* global axios */
import ApiClient from './ApiClient';
class LiveReportsAPI extends ApiClient {
constructor() {
super('live_reports', { accountScoped: true, apiVersion: 'v2' });
}
getConversationMetric() {
return axios.get(`${this.url}/conversation_metrics`);
}
getGroupedConversations({ groupBy } = { groupBy: 'assignee_id' }) {
return axios.get(`${this.url}/grouped_conversation_metrics`, {
params: { group_by: groupBy },
});
}
}
export default new LiveReportsAPI();