feat: Add date-range filter on CSAT Reports (#2622)

This commit is contained in:
Pranav Raj S 2021-07-14 20:15:57 +05:30 committed by GitHub
parent a5bc81b304
commit 3d18ec9e40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 175 additions and 120 deletions

View file

@ -6,12 +6,16 @@ class CSATReportsAPI extends ApiClient {
super('csat_survey_responses', { accountScoped: true });
}
get({ page } = {}) {
return axios.get(this.url, { params: { page } });
get({ page, from, to } = {}) {
return axios.get(this.url, {
params: { page, since: from, until: to, sort: '-created_at' },
});
}
getMetrics() {
return axios.get(`${this.url}/metrics`);
getMetrics({ from, to } = {}) {
return axios.get(`${this.url}/metrics`, {
params: { since: from, until: to },
});
}
}