feat: Add date-range filter on CSAT Reports (#2622)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user