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
10 changed files with 175 additions and 120 deletions

View File

@@ -82,10 +82,10 @@ export const getters = {
};
export const actions = {
get: async function getResponses({ commit }, { page = 1 } = {}) {
get: async function getResponses({ commit }, { page = 1, from, to } = {}) {
commit(types.SET_CSAT_RESPONSE_UI_FLAG, { isFetching: true });
try {
const response = await CSATReports.get({ page });
const response = await CSATReports.get({ page, from, to });
commit(types.SET_CSAT_RESPONSE, response.data);
} catch (error) {
// Ignore error
@@ -93,10 +93,10 @@ export const actions = {
commit(types.SET_CSAT_RESPONSE_UI_FLAG, { isFetching: false });
}
},
getMetrics: async function getMetrics({ commit }) {
getMetrics: async function getMetrics({ commit }, { from, to }) {
commit(types.SET_CSAT_RESPONSE_UI_FLAG, { isFetchingMetrics: true });
try {
const response = await CSATReports.getMetrics();
const response = await CSATReports.getMetrics({ from, to });
commit(types.SET_CSAT_RESPONSE_METRICS, response.data);
} catch (error) {
// Ignore error